Changeset 3542
- Timestamp:
- 05/16/08 19:54:30 (4 years ago)
- Location:
- trunk/pfixcore
- Files:
-
- 9 added
- 47 modified
-
.project (modified) (2 diffs)
-
ChangeLog (modified) (1 diff)
-
build.xml (modified) (1 diff)
-
projects/common/conf/factory.xml (modified) (1 diff)
-
projects/core/dyntxt/statuscodeinfo.xml (added)
-
projects/core/dyntxt/statusmessages_core.xml (added)
-
projects/core/dyntxt/statusmessages_editor.xml (added)
-
projects/core/schema/statuscodeinfo.xsd (added)
-
projects/sample1/dyntxt/statuscodeinfo.xml (added)
-
projects/sample1/script/ScriptingState.bsh (modified) (1 diff)
-
projects/sample1/script/ScriptingTShirt.js (modified) (1 diff)
-
projects/samplebank/dyntxt/statuscodeinfo.xml (added)
-
projects/testsuite/dyntxt/statuscodeinfo.xml (added)
-
skel/build-skel.xml (modified) (3 diffs)
-
src/de/schlund/pfixcore/editor2/frontend/handlers/CommonBranchIncludePartHandler.java (modified) (4 diffs)
-
src/de/schlund/pfixcore/editor2/frontend/handlers/CommonRestoreIncludePartHandler.java (modified) (3 diffs)
-
src/de/schlund/pfixcore/editor2/frontend/handlers/CommonSelectIncludePartHandler.java (modified) (3 diffs)
-
src/de/schlund/pfixcore/editor2/frontend/handlers/CommonUploadIncludePartHandler.java (modified) (5 diffs)
-
src/de/schlund/pfixcore/editor2/frontend/handlers/DeleteUsersHandler.java (modified) (3 diffs)
-
src/de/schlund/pfixcore/editor2/frontend/handlers/EditUserHandler.java (modified) (6 diffs)
-
src/de/schlund/pfixcore/editor2/frontend/handlers/LoginHandler.java (modified) (3 diffs)
-
src/de/schlund/pfixcore/editor2/frontend/handlers/RestoreImageHandler.java (modified) (3 diffs)
-
src/de/schlund/pfixcore/editor2/frontend/handlers/SelectImageHandler.java (modified) (3 diffs)
-
src/de/schlund/pfixcore/editor2/frontend/handlers/SelectPageHandler.java (modified) (3 diffs)
-
src/de/schlund/pfixcore/editor2/frontend/handlers/SelectProjectHandler.java (modified) (3 diffs)
-
src/de/schlund/pfixcore/editor2/frontend/handlers/SelectTargetHandler.java (modified) (3 diffs)
-
src/de/schlund/pfixcore/editor2/frontend/handlers/SelectUserHandler.java (modified) (3 diffs)
-
src/de/schlund/pfixcore/editor2/frontend/handlers/UploadImageHandler.java (modified) (6 diffs)
-
src/de/schlund/pfixcore/example/CounterHandler.java (modified) (1 diff)
-
src/de/schlund/pfixcore/example/CounterSetHandler.java (modified) (1 diff)
-
src/de/schlund/pfixcore/example/TShirtHandler.java (modified) (1 diff)
-
src/de/schlund/pfixcore/example/TrouserHandler.java (modified) (1 diff)
-
src/de/schlund/pfixcore/example/bank/ihandler/LoginHandler.java (modified) (2 diffs)
-
src/de/schlund/pfixcore/example/iwrapper/AdultInfo.iwrp (modified) (1 diff)
-
src/de/schlund/pfixcore/generator/IWrapperParam.java (modified) (4 diffs)
-
src/de/schlund/pfixcore/generator/casters/ToBoolean.java (modified) (2 diffs)
-
src/de/schlund/pfixcore/generator/casters/ToByte.java (modified) (2 diffs)
-
src/de/schlund/pfixcore/generator/casters/ToDate.java (modified) (2 diffs)
-
src/de/schlund/pfixcore/generator/casters/ToDouble.java (modified) (2 diffs)
-
src/de/schlund/pfixcore/generator/casters/ToFile.java (modified) (3 diffs)
-
src/de/schlund/pfixcore/generator/casters/ToFloat.java (modified) (2 diffs)
-
src/de/schlund/pfixcore/generator/casters/ToInteger.java (modified) (2 diffs)
-
src/de/schlund/pfixcore/generator/casters/ToLong.java (modified) (2 diffs)
-
src/de/schlund/pfixcore/generator/casters/ToPerl5Pattern.java (modified) (3 diffs)
-
src/de/schlund/pfixcore/generator/casters/ToUploadFile.java (modified) (3 diffs)
-
src/de/schlund/pfixcore/generator/postchecks/FloatRange.java (modified) (2 diffs)
-
src/de/schlund/pfixcore/generator/postchecks/IntegerRange.java (modified) (2 diffs)
-
src/de/schlund/pfixcore/generator/postchecks/StringLength.java (modified) (2 diffs)
-
src/de/schlund/pfixcore/generator/prechecks/RegexpCheck.java (modified) (4 diffs)
-
src/de/schlund/pfixcore/lucefix/SearchHandler.java (modified) (3 diffs)
-
src/de/schlund/pfixcore/testsuite/handler/Test5PageMessageHandler.java (modified) (1 diff)
-
src/de/schlund/pfixcore/util/GenerateSCodes.java (modified) (7 diffs)
-
src/de/schlund/pfixcore/util/GenerateSCodesTask.java (added)
-
src/de/schlund/pfixcore/workflow/app/DefaultIWrapperState.java (modified) (4 diffs)
-
src/de/schlund/util/statuscodes/StatusCode.java (modified) (1 diff)
-
src/de/schlund/util/statuscodes/StatusCodeHelper.java (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pfixcore/.project
r3165 r3542 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <projectDescription> 3 <name>pfixcore .TRUNK</name>3 <name>pfixcore</name> 4 4 <comment></comment> 5 5 <projects> 6 6 </projects> 7 7 <buildSpec> 8 <buildCommand>9 <name>de.schlund.pfixcore.eclipseplugin.pustefixBuilder</name>10 <arguments>11 </arguments>12 </buildCommand>13 8 <buildCommand> 14 9 <name>org.eclipse.jdt.core.javabuilder</name> … … 20 15 <nature>org.eclipse.jdt.core.javanature</nature> 21 16 <nature>org.eclipse.team.cvs.core.cvsnature</nature> 22 <nature>de.schlund.pfixcore.eclipseplugin.pustefixNature</nature>23 17 </natures> 24 18 </projectDescription> -
trunk/pfixcore/ChangeLog
r3537 r3542 1 2008-05-16 Martin Leidig <mleidig@schlund.de> 2 3 Added StatusCode modularization support. Now multiple classes 4 containing StatusCode constants are supported. You can control 5 the StatusCode constant class generation by supplying a 6 meta information file (statuscodeinfo.xml), where you can 7 define the class names and which statusmessage files should 8 be used to generate the classes. The meta information file 9 by default can be placed in the configuration or dyntxt 10 directories (projects/*/conf, projects/*/dyntxt). 11 The builtin Pustefix StatusCodes have been modularized too. 12 They were split into core and editor StatusCodes. To obtain 13 backwards compatibility we still have a shared version, 14 which can be used to generate the old StatusCodeLib class, 15 but we should enforce changing to the modularized approach, 16 therefore we should provide some migration tooling support, 17 e.g. for splitting statusmessage files and renaming statuscodes. 18 19 Modified: 20 21 Use new StatusCodes classes instead of shared StatusCodeLib: 22 * src/de/schlund/pfixcore/lucefix/SearchHandler.java 23 * src/de/schlund/pfixcore/generator/IWrapperParam.java 24 * src/de/schlund/pfixcore/generator/casters/ToDate.java 25 * src/de/schlund/pfixcore/generator/casters/ToInteger.java 26 * src/de/schlund/pfixcore/generator/casters/ToBoolean.java 27 * src/de/schlund/pfixcore/generator/casters/ToFile.java 28 * src/de/schlund/pfixcore/generator/casters/ToLong.java 29 * src/de/schlund/pfixcore/generator/casters/ToByte.java 30 * src/de/schlund/pfixcore/generator/casters/ToUploadFile.java 31 * src/de/schlund/pfixcore/generator/casters/ToFloat.java 32 * src/de/schlund/pfixcore/generator/casters/ToPerl5Pattern.java 33 * src/de/schlund/pfixcore/generator/casters/ToDouble.java 34 * src/de/schlund/pfixcore/generator/postchecks/FloatRange.java 35 * src/de/schlund/pfixcore/generator/postchecks/StringLength.java 36 * src/de/schlund/pfixcore/generator/postchecks/IntegerRange.java 37 * src/de/schlund/pfixcore/generator/prechecks/RegexpCheck.java 38 * src/de/schlund/pfixcore/editor2/frontend/handlers/CommonBranchIncludePartHandler.java 39 * src/de/schlund/pfixcore/editor2/frontend/handlers/SelectProjectHandler.java 40 * src/de/schlund/pfixcore/editor2/frontend/handlers/LoginHandler.java 41 * src/de/schlund/pfixcore/editor2/frontend/handlers/SelectPageHandler.java 42 * src/de/schlund/pfixcore/editor2/frontend/handlers/SelectUserHandler.java 43 * src/de/schlund/pfixcore/editor2/frontend/handlers/SelectImageHandler.java 44 * src/de/schlund/pfixcore/editor2/frontend/handlers/CommonSelectIncludePartHandler.java 45 * src/de/schlund/pfixcore/editor2/frontend/handlers/DeleteUsersHandler.java 46 * src/de/schlund/pfixcore/editor2/frontend/handlers/EditUserHandler.java 47 * src/de/schlund/pfixcore/editor2/frontend/handlers/RestoreImageHandler.java 48 * src/de/schlund/pfixcore/editor2/frontend/handlers/SelectTargetHandler.java 49 * src/de/schlund/pfixcore/editor2/frontend/handlers/CommonRestoreIncludePartHandler.java 50 * src/de/schlund/pfixcore/editor2/frontend/handlers/UploadImageHandler.java 51 * src/de/schlund/pfixcore/editor2/frontend/handlers/CommonUploadIncludePartHandler.java 52 * src/de/schlund/pfixcore/testsuite/handler/Test5PageMessageHandler.java 53 * src/de/schlund/pfixcore/workflow/app/DefaultIWrapperState.java 54 * src/de/schlund/pfixcore/example/TrouserHandler.java 55 * src/de/schlund/pfixcore/example/bank/ihandler/LoginHandler.java 56 * src/de/schlund/pfixcore/example/iwrapper/AdultInfo.iwrp 57 * src/de/schlund/pfixcore/example/TShirtHandler.java 58 * src/de/schlund/pfixcore/example/CounterHandler.java 59 * src/de/schlund/pfixcore/example/CounterSetHandler.java 60 * projects/sample1/script/ScriptingTShirt.js 61 * projects/sample1/script/ScriptingState.bsh 62 63 * projects/common/conf/factory.xml: removed statusmessage properties 64 * src/de/schlund/pfixcore/util/GenerateSCodes.java: added support for statuscode 65 generation based on meta information in statuscodeinfo.xml files, cache 66 DocrootResources in array, made classname exchangeable 67 * src/de/schlund/util/statuscodes/StatusCode.java: made constructor public 68 * skel/build-skel.xml: use new ant task to generate statuscodes 69 * build.xml: add new ant task to precompilation target 70 71 Added: 72 73 * src/de/schlund/pfixcore/util/GenerateSCodesTask.java: new ant task 74 for statuscode class generation, which uses the GenerateSCodes utility 75 class, the task sets an ant property containing the generated classes, 76 which are subsequently compiled 77 * src/de/schlund/util/statuscodes/StatusCodeHelper.java: helper class, 78 which should be used to retrieve StatusCodes by their name, it 79 delegates getStatusCodeByName calls to the responsible StatusCodes class 80 by inspecting the StatusCode name (checks if a class name is supplied, 81 delimited by '#' sign, and calls getStatusCodeByName at this class) 82 83 * projects/core/schema/statuscodeinfo.xsd: schema definition for 84 statuscode meta information 85 86 Split pfixcore statusmessages.xml in editor and core: 87 * projects/core/dyntxt/statusmessages_editor.xml 88 * projects/core/dyntxt/statusmessages_core.xml 89 90 Added statuscode meta information: 91 * projects/core/dyntxt/statuscodeinfo.xml 92 * projects/testsuite/dyntxt/statuscodeinfo.xml 93 * projects/sample1/dyntxt/statuscodeinfo.xml 94 * projects/samplebank/dyntxt/statuscodeinfo.xml 95 1 96 2008-05-08 jtl <jtl@schoenberg.laudi.ka> 2 97 -
trunk/pfixcore/build.xml
r3522 r3542 77 77 srcdir="${dir.src}" 78 78 destdir="${dir.build}" 79 includes="de/schlund/pfixcore/util/XsltGenericTask.java, de/schlund/pfixxml/config/BuildTimePropTask.java, de/schlund/pfixcore/util/GenerateSCodes.java "79 includes="de/schlund/pfixcore/util/XsltGenericTask.java, de/schlund/pfixxml/config/BuildTimePropTask.java, de/schlund/pfixcore/util/GenerateSCodes.java de/schlund/pfixcore/util/GenerateSCodesTask.java" 80 80 debug="${debug}" 81 81 classpathref="cp.classpath" -
trunk/pfixcore/projects/common/conf/factory.xml
r3280 r3542 34 34 <prop name="de.schlund.pfixcore.editor2.updatetargets">true</prop> 35 35 36 <!-- part index -->37 <prop name="partindex.scodefile.1">core/dyntxt/statusmessages.xml</prop>38 <prop name="partindex.scodefile.2">sample1/dyntxt/statusmessages.xml</prop>39 <prop name="partindex.scodefile.3">testsuite/dyntxt/statusmessages.xml</prop>40 <prop name="partindex.scodefile.4">samplebank/dyntxt/statusmessages.xml</prop>41 42 36 <!-- SPCacheFactory --> 43 37 <prop name="targetcache.cacheclass">de.schlund.pfixxml.targets.LRUCache</prop> -
trunk/pfixcore/projects/sample1/script/ScriptingState.bsh
r3534 r3542 2 2 import de.schlund.pfixcore.workflow.Context; 3 3 import de.schlund.pfixxml.PfixServletRequest; 4 import de.schlund. util.statuscodes.StatusCodeLib;4 import de.schlund.pfixcore.example.StatusCodeLib; 5 5 6 6 -
trunk/pfixcore/projects/sample1/script/ScriptingTShirt.js
r3534 r3542 1 1 2 importClass(Packages.de.schlund. util.statuscodes.StatusCodeLib);2 importClass(Packages.de.schlund.pfixcore.example.StatusCodeLib); 3 3 4 4 // the LOG object is predefined (declared in BSF terms) in every script -
trunk/pfixcore/skel/build-skel.xml
r3428 r3542 335 335 loaderref="pfx-loader" 336 336 /> 337 <taskdef 338 name="pfx-sclibgen" 339 classname="de.schlund.pfixcore.util.GenerateSCodesTask" 340 classpathref="cp.classpath" 341 loaderref="pfx-loader" 342 description="Generate StatusCodeLib from statusmessages" 343 /> 337 344 </target> 338 345 … … 560 567 /> 561 568 </target> 562 569 563 570 <target name="scgenerate" depends="propfiles"> 564 <java classname="de.schlund.pfixcore.util.GenerateSCodes" fork="true" classpathref="cp.classpath" failonerror="true"> 565 <arg value="${dir.gensrc}/de/schlund/util/statuscodes/StatusCodeLib.java"/> 566 <arg value="${dir.projects}/common/conf/factory.xml"/> 567 <arg value="${dir.projects}"/> 568 </java> 571 <pfx-sclibgen 572 gendir="${dir.gensrc}" 573 docroot="${dir.projects}" 574 property="scgenerate.classes" 575 includes="*/dyntxt/statuscodeinfo.xml */conf/statuscodeinfo.xml" 576 /> 569 577 <javac 570 578 srcdir="${dir.src}" … … 579 587 srcdir="${dir.gensrc}" 580 588 destdir="${dir.build}" 581 includes=" de/schlund/util/statuscodes/StatusCodeLib.java"589 includes="${scgenerate.classes}" 582 590 debug="${debug}" 583 591 classpathref="cp.classpath" 584 592 encoding="${javac.encoding}" 585 593 > 586 </javac> 594 </javac> 587 595 </target> 588 596 -
trunk/pfixcore/src/de/schlund/pfixcore/editor2/frontend/handlers/CommonBranchIncludePartHandler.java
r2289 r3542 19 19 package de.schlund.pfixcore.editor2.frontend.handlers; 20 20 21 import org.pustefixframework.CoreStatusCodes; 22 import org.pustefixframework.editor.EditorStatusCodes; 23 21 24 import de.schlund.pfixcore.editor2.frontend.resources.CommonIncludesResource; 22 25 import de.schlund.pfixcore.editor2.frontend.wrappers.CommonBranchIncludePart; … … 24 27 import de.schlund.pfixcore.generator.IWrapper; 25 28 import de.schlund.pfixcore.workflow.Context; 26 import de.schlund.util.statuscodes.StatusCodeLib;27 29 28 30 /** … … 40 42 if (input.getAction().equals("create")) { 41 43 if (input.getTheme() == null || input.getTheme().equals("")) { 42 input.addSCodeAction( StatusCodeLib.PFIXCORE_GENERATOR_MISSING_PARAM);44 input.addSCodeAction(CoreStatusCodes.MISSING_PARAM); 43 45 return; 44 46 } … … 46 48 input.getTheme())) { 47 49 input 48 .addSCodeAction( StatusCodeLib.PFIXCORE_EDITOR_INCLUDES_BRANCH_CREATE_FAILED);50 .addSCodeAction(EditorStatusCodes.INCLUDES_BRANCH_CREATE_FAILED); 49 51 } 50 52 } else if (input.getAction().equals("delete")) { 51 53 if (!this.getResource(context).deleteSelectedBranch()) { 52 54 input 53 .addSCodeAction( StatusCodeLib.PFIXCORE_EDITOR_INCLUDES_BRANCH_DELETE_FAILED);55 .addSCodeAction(EditorStatusCodes.INCLUDES_BRANCH_DELETE_FAILED); 54 56 } 55 57 } -
trunk/pfixcore/src/de/schlund/pfixcore/editor2/frontend/handlers/CommonRestoreIncludePartHandler.java
r2289 r3542 19 19 package de.schlund.pfixcore.editor2.frontend.handlers; 20 20 21 import org.pustefixframework.editor.EditorStatusCodes; 22 21 23 import de.schlund.pfixcore.editor2.frontend.resources.CommonIncludesResource; 22 24 import de.schlund.pfixcore.editor2.frontend.wrappers.CommonRestoreIncludePart; … … 24 26 import de.schlund.pfixcore.generator.IWrapper; 25 27 import de.schlund.pfixcore.workflow.Context; 26 import de.schlund.util.statuscodes.StatusCodeLib;27 28 28 29 /** … … 41 42 input.getHash()); 42 43 if (ret == 1) { 43 input.addSCodeVersion( StatusCodeLib.PFIXCORE_EDITOR_INCLUDES_INCLUDE_UNDEF);44 input.addSCodeVersion(EditorStatusCodes.INCLUDES_INCLUDE_UNDEF); 44 45 } else if (ret == 2) { 45 46 input 46 .addSCodeVersion( StatusCodeLib.PFIXCORE_EDITOR_INCLUDESUPLOAD_INCLUDE_HAS_CHANGED_RESTORE);47 .addSCodeVersion(EditorStatusCodes.INCLUDESUPLOAD_INCLUDE_HAS_CHANGED_RESTORE); 47 48 } 48 49 } -
trunk/pfixcore/src/de/schlund/pfixcore/editor2/frontend/handlers/CommonSelectIncludePartHandler.java
r2289 r3542 19 19 package de.schlund.pfixcore.editor2.frontend.handlers; 20 20 21 import org.pustefixframework.editor.EditorStatusCodes; 22 21 23 import de.schlund.pfixcore.editor2.frontend.resources.CommonIncludesResource; 22 24 import de.schlund.pfixcore.editor2.frontend.util.EditorResourceLocator; … … 25 27 import de.schlund.pfixcore.generator.IWrapper; 26 28 import de.schlund.pfixcore.workflow.Context; 27 import de.schlund.util.statuscodes.StatusCodeLib;28 29 29 30 /** … … 41 42 if (!this.getResource(context).selectIncludePart(input.getPath(), 42 43 input.getPart(), input.getTheme())) { 43 input.addSCodePath( StatusCodeLib.PFIXCORE_EDITOR_INCLUDES_INCLUDE_UNDEF);44 input.addSCodePath(EditorStatusCodes.INCLUDES_INCLUDE_UNDEF); 44 45 } 45 46 } -
trunk/pfixcore/src/de/schlund/pfixcore/editor2/frontend/handlers/CommonUploadIncludePartHandler.java
r3216 r3542 20 20 21 21 import org.apache.log4j.Logger; 22 import org.pustefixframework.editor.EditorStatusCodes; 22 23 import org.xml.sax.SAXException; 23 24 … … 30 31 import de.schlund.pfixcore.generator.IWrapper; 31 32 import de.schlund.pfixcore.workflow.Context; 32 import de.schlund.util.statuscodes.StatusCodeLib;33 33 34 34 /** … … 59 59 String path = this.getResource(context).getSelectedIncludePart().getIncludePart().getIncludeFile().getPath(); 60 60 if (path.lastIndexOf('/') == -1 || path.lastIndexOf('/') == 0) { 61 input.addSCodeContent( StatusCodeLib.PFIXCORE_EDITOR_INCLUDESUPLOAD_FILE_IS_IN_ROOT);61 input.addSCodeContent(EditorStatusCodes.INCLUDESUPLOAD_FILE_IS_IN_ROOT); 62 62 return; 63 63 } … … 71 71 Logger.getLogger(this.getClass()).warn(e); 72 72 input 73 .addSCodeContent( StatusCodeLib.PFIXCORE_EDITOR_INCLUDESUPLOAD_PARSE_ERR);73 .addSCodeContent(EditorStatusCodes.INCLUDESUPLOAD_PARSE_ERR); 74 74 } catch (EditorIncludeHasChangedException e) { 75 75 input.setHash(e.getNewHash()); … … 77 77 input.setContent(e.getMerged()); 78 78 input 79 .addSCodeContent( StatusCodeLib.PFIXCORE_EDITOR_INCLUDESUPLOAD_INCLUDE_HAS_CHANGED);79 .addSCodeContent(EditorStatusCodes.INCLUDESUPLOAD_INCLUDE_HAS_CHANGED); 80 80 return; 81 81 } catch (EditorException e) { 82 82 input 83 .addSCodeContent( StatusCodeLib.PFIXCORE_EDITOR_INCLUDESUPLOAD_GEN_ERR);83 .addSCodeContent(EditorStatusCodes.INCLUDESUPLOAD_GEN_ERR); 84 84 return; 85 85 } -
trunk/pfixcore/src/de/schlund/pfixcore/editor2/frontend/handlers/DeleteUsersHandler.java
r2289 r3542 19 19 package de.schlund.pfixcore.editor2.frontend.handlers; 20 20 21 import org.pustefixframework.CoreStatusCodes; 22 21 23 import de.schlund.pfixcore.editor2.core.exception.EditorUserNotExistingException; 22 24 import de.schlund.pfixcore.editor2.frontend.util.EditorResourceLocator; … … 26 28 import de.schlund.pfixcore.generator.IWrapper; 27 29 import de.schlund.pfixcore.workflow.Context; 28 import de.schlund.util.statuscodes.StatusCodeLib;29 30 30 31 /** … … 44 45 usernames); 45 46 } catch (EditorUserNotExistingException e) { 46 input.addSCodeUsername( StatusCodeLib.PFIXCORE_GEN_ERROR);47 input.addSCodeUsername(CoreStatusCodes.GEN_ERROR); 47 48 } 48 49 } -
trunk/pfixcore/src/de/schlund/pfixcore/editor2/frontend/handlers/EditUserHandler.java
r3520 r3542 21 21 import java.util.Iterator; 22 22 23 import org.pustefixframework.CoreStatusCodes; 24 import org.pustefixframework.editor.EditorStatusCodes; 25 23 26 import de.schlund.pfixcore.editor2.core.dom.Project; 24 27 import de.schlund.pfixcore.editor2.core.vo.EditorGlobalPermissions; … … 32 35 import de.schlund.pfixcore.util.UnixCrypt; 33 36 import de.schlund.pfixcore.workflow.Context; 34 import de.schlund.util.statuscodes.StatusCodeLib;35 37 36 38 /** … … 49 51 name = input.getName(); 50 52 if (name == null) { 51 input.addSCodeName( StatusCodeLib.PFIXCORE_GENERATOR_MISSING_PARAM);53 input.addSCodeName(CoreStatusCodes.MISSING_PARAM); 52 54 } 53 55 section = input.getSection(); 54 56 if (section == null) { 55 input.addSCodeSection( StatusCodeLib.PFIXCORE_GENERATOR_MISSING_PARAM);57 input.addSCodeSection(CoreStatusCodes.MISSING_PARAM); 56 58 } 57 59 phone = input.getPhone(); 58 60 if (phone == null) { 59 input.addSCodePhone( StatusCodeLib.PFIXCORE_GENERATOR_MISSING_PARAM);61 input.addSCodePhone(CoreStatusCodes.MISSING_PARAM); 60 62 } 61 63 EditorUser user = EditorResourceLocator.getUsersResource(context) … … 68 70 } else { 69 71 input 70 .addSCodePassword( StatusCodeLib.PFIXCORE_EDITOR_USERDATA_PWD_NO_MATCH);72 .addSCodePassword(EditorStatusCodes.USERDATA_PWD_NO_MATCH); 71 73 return; 72 74 } 73 75 } else if (input.getPasswordRepeat() != null) { 74 76 input 75 .addSCodePassword( StatusCodeLib.PFIXCORE_EDITOR_USERDATA_PWD_NO_MATCH);77 .addSCodePassword(EditorStatusCodes.USERDATA_PWD_NO_MATCH); 76 78 return; 77 79 } … … 80 82 if (!EditorResourceLocator.getUsersResource(context).existsSelectedUser() 81 83 && pwd == null && input.getPasswordRepeat() == null) { 82 input.addSCodePassword( StatusCodeLib.PFIXCORE_GENERATOR_MISSING_PARAM);84 input.addSCodePassword(CoreStatusCodes.MISSING_PARAM); 83 85 return; 84 86 } … … 125 127 126 128 EditorResourceLocator.getUsersResource(context).updateSelectedUser(); 127 context.addPageMessage( StatusCodeLib.PFIXCORE_EDITOR_USERDATA_CHANGES_SAVED, null, null);129 context.addPageMessage(EditorStatusCodes.USERDATA_CHANGES_SAVED, null, null); 128 130 } 129 131 -
trunk/pfixcore/src/de/schlund/pfixcore/editor2/frontend/handlers/LoginHandler.java
r2289 r3542 19 19 package de.schlund.pfixcore.editor2.frontend.handlers; 20 20 21 import org.pustefixframework.editor.EditorStatusCodes; 22 21 23 import de.schlund.pfixcore.editor2.frontend.util.EditorResourceLocator; 22 24 import de.schlund.pfixcore.editor2.frontend.wrappers.Login; … … 24 26 import de.schlund.pfixcore.generator.IWrapper; 25 27 import de.schlund.pfixcore.workflow.Context; 26 import de.schlund.util.statuscodes.StatusCodeLib;27 28 28 29 /** … … 40 41 if (EditorResourceLocator.getSessionResource(context) 41 42 .isUserLoginsAllowed()) { 42 input.addSCodePass( StatusCodeLib.PFIXCORE_EDITOR_AUTH_WRONG_USER_OR_PASS);43 input.addSCodePass(EditorStatusCodes.AUTH_WRONG_USER_OR_PASS); 43 44 } else { 44 45 input 45 .addSCodePass( StatusCodeLib.PFIXCORE_EDITOR_AUTH_NO_LOGIN_ALLOWED);46 .addSCodePass(EditorStatusCodes.AUTH_NO_LOGIN_ALLOWED); 46 47 } 47 48 } -
trunk/pfixcore/src/de/schlund/pfixcore/editor2/frontend/handlers/RestoreImageHandler.java
r2289 r3542 19 19 package de.schlund.pfixcore.editor2.frontend.handlers; 20 20 21 import org.pustefixframework.editor.EditorStatusCodes; 22 21 23 import de.schlund.pfixcore.editor2.frontend.util.EditorResourceLocator; 22 24 import de.schlund.pfixcore.editor2.frontend.wrappers.RestoreImage; … … 24 26 import de.schlund.pfixcore.generator.IWrapper; 25 27 import de.schlund.pfixcore.workflow.Context; 26 import de.schlund.util.statuscodes.StatusCodeLib;27 28 28 29 /** … … 40 41 input.getLastModTime().longValue()); 41 42 if (ret == 1) { 42 input.addSCodeVersion( StatusCodeLib.PFIXCORE_EDITOR_IMAGES_IMAGE_UNDEF);43 input.addSCodeVersion(EditorStatusCodes.IMAGES_IMAGE_UNDEF); 43 44 } else if (ret == 2) { 44 45 input 45 .addSCodeVersion( StatusCodeLib.PFIXCORE_EDITOR_IMAGESUPLOAD_IMAGEUPL_HASCHANGED);46 .addSCodeVersion(EditorStatusCodes.IMAGESUPLOAD_IMAGEUPL_HASCHANGED); 46 47 } 47 48 } -
trunk/pfixcore/src/de/schlund/pfixcore/editor2/frontend/handlers/SelectImageHandler.java
r2289 r3542 19 19 package de.schlund.pfixcore.editor2.frontend.handlers; 20 20 21 import org.pustefixframework.editor.EditorStatusCodes; 22 21 23 import de.schlund.pfixcore.editor2.frontend.util.EditorResourceLocator; 22 24 import de.schlund.pfixcore.editor2.frontend.wrappers.SelectImage; … … 24 26 import de.schlund.pfixcore.generator.IWrapper; 25 27 import de.schlund.pfixcore.workflow.Context; 26 import de.schlund.util.statuscodes.StatusCodeLib;27 28 28 29 /** … … 38 39 if (!EditorResourceLocator.getImagesResource(context).selectImage( 39 40 input.getPath())) { 40 input.addSCodePath( StatusCodeLib.PFIXCORE_EDITOR_IMAGES_IMAGE_UNDEF);41 input.addSCodePath(EditorStatusCodes.IMAGES_IMAGE_UNDEF); 41 42 } 42 43 } -
trunk/pfixcore/src/de/schlund/pfixcore/editor2/frontend/handlers/SelectPageHandler.java
r3528 r3542 19 19 package de.schlund.pfixcore.editor2.frontend.handlers; 20 20 21 import org.pustefixframework.editor.EditorStatusCodes; 22 21 23 import de.schlund.pfixcore.editor2.frontend.util.EditorResourceLocator; 22 24 import de.schlund.pfixcore.editor2.frontend.wrappers.SelectPage; … … 24 26 import de.schlund.pfixcore.generator.IWrapper; 25 27 import de.schlund.pfixcore.workflow.Context; 26 import de.schlund.util.statuscodes.StatusCodeLib;27 28 28 29 /** … … 36 37 SelectPage input = (SelectPage) wrapper; 37 38 if (!EditorResourceLocator.getPagesResource(context).selectPage(input.getPageName(), input.getVariantName())) { 38 input.addSCodePageName( StatusCodeLib.PFIXCORE_EDITOR_PAGES_PAGE_UNDEF);39 input.addSCodePageName(EditorStatusCodes.PAGES_PAGE_UNDEF); 39 40 } 40 41 } -
trunk/pfixcore/src/de/schlund/pfixcore/editor2/frontend/handlers/SelectProjectHandler.java
r3528 r3542 19 19 package de.schlund.pfixcore.editor2.frontend.handlers; 20 20 21 import org.pustefixframework.editor.EditorStatusCodes; 22 21 23 import de.schlund.pfixcore.editor2.frontend.util.EditorResourceLocator; 22 24 import de.schlund.pfixcore.editor2.frontend.wrappers.SelectProject; … … 24 26 import de.schlund.pfixcore.generator.IWrapper; 25 27 import de.schlund.pfixcore.workflow.Context; 26 import de.schlund.util.statuscodes.StatusCodeLib;27 28 28 29 /** … … 36 37 SelectProject input = (SelectProject) wrapper; 37 38 if (!EditorResourceLocator.getProjectsResource(context).selectProject(input.getProjectName())) { 38 input.addSCodeProjectName( StatusCodeLib.PFIXCORE_EDITOR_PRODUCTSELECT_UNKNOWN_PRODUCT);39 input.addSCodeProjectName(EditorStatusCodes.PRODUCTSELECT_UNKNOWN_PRODUCT); 39 40 } 40 41 } -
trunk/pfixcore/src/de/schlund/pfixcore/editor2/frontend/handlers/SelectTargetHandler.java
r2289 r3542 19 19 package de.schlund.pfixcore.editor2.frontend.handlers; 20 20 21 import org.pustefixframework.editor.EditorStatusCodes; 22 21 23 import de.schlund.pfixcore.editor2.frontend.util.EditorResourceLocator; 22 24 import de.schlund.pfixcore.editor2.frontend.wrappers.SelectTarget; … … 24 26 import de.schlund.pfixcore.generator.IWrapper; 25 27 import de.schlund.pfixcore.workflow.Context; 26 import de.schlund.util.statuscodes.StatusCodeLib;27 28 28 29 /** … … 38 39 if (!EditorResourceLocator.getTargetsResource(context).selectTarget( 39 40 input.getTargetName())) { 40 input.addSCodeTargetName( StatusCodeLib.PFIXCORE_EDITOR_TARGETS_TARGET_UNDEF);41 input.addSCodeTargetName(EditorStatusCodes.TARGETS_TARGET_UNDEF); 41 42 } 42 43 } -
trunk/pfixcore/src/de/schlund/pfixcore/editor2/frontend/handlers/SelectUserHandler.java
r2289 r3542 19 19 package de.schlund.pfixcore.editor2.frontend.handlers; 20 20 21 import org.pustefixframework.editor.EditorStatusCodes; 22 21 23 import de.schlund.pfixcore.editor2.core.exception.EditorDuplicateUsernameException; 22 24 import de.schlund.pfixcore.editor2.frontend.util.EditorResourceLocator; … … 26 28 import de.schlund.pfixcore.generator.IWrapper; 27 29 import de.schlund.pfixcore.workflow.Context; 28 import de.schlund.util.statuscodes.StatusCodeLib;29 30 30 31 /** … … 43 44 .createAndSelectUser(input.getUsername()); 44 45 } catch (EditorDuplicateUsernameException e) { 45 input.addSCodeUsername( StatusCodeLib.PFIXCORE_EDITOR_ADDUSER_USER_EXISTS);46 input.addSCodeUsername(EditorStatusCodes.ADDUSER_USER_EXISTS); 46 47 } 47 48 } else { -
trunk/pfixcore/src/de/schlund/pfixcore/editor2/frontend/handlers/UploadImageHandler.java
r2696 r3542 22 22 import java.io.FileInputStream; 23 23 24 import org.pustefixframework.editor.EditorStatusCodes; 25 24 26 import de.schlund.pfixcore.editor2.core.dom.Image; 25 27 import de.schlund.pfixcore.editor2.frontend.util.EditorResourceLocator; … … 29 31 import de.schlund.pfixcore.workflow.Context; 30 32 import de.schlund.pfixxml.ImageInfo; 31 import de.schlund.util.statuscodes.StatusCodeLib;32 33 33 34 /** … … 45 46 info.setInput(new FileInputStream(uploadFile)); 46 47 if (!info.check()) { 47 input.addSCodeImageFile( StatusCodeLib.PFIXCORE_EDITOR_IMAGESUPLOAD_IMAGEUPL_NOFILE);48 input.addSCodeImageFile(EditorStatusCodes.IMAGESUPLOAD_IMAGEUPL_NOFILE); 48 49 return; 49 50 } … … 52 53 .getSelectedImage(); 53 54 if (image == null) { 54 input.addSCodeImageFile( StatusCodeLib.PFIXCORE_EDITOR_IMAGESUPLOAD_IMAGEUPL_WRONGTYPE);55 input.addSCodeImageFile(EditorStatusCodes.IMAGESUPLOAD_IMAGEUPL_WRONGTYPE); 55 56 } 56 57 String imagePath = image.getPath(); 57 58 if (imagePath.lastIndexOf('/') == -1 || imagePath.lastIndexOf('/') == 0) { 58 input.addSCodeImageFile( StatusCodeLib.PFIXCORE_EDITOR_IMAGESUPLOAD_FILE_IS_IN_ROOT);59 input.addSCodeImageFile(EditorStatusCodes.IMAGESUPLOAD_FILE_IS_IN_ROOT); 59 60 return; 60 61 } … … 65 66 if (image.getLastModTime() != input.getLastModTime().longValue()) { 66 67 input 67 .addSCodeImageFile( StatusCodeLib.PFIXCORE_EDITOR_IMAGESUPLOAD_IMAGEUPL_HASCHANGED);68 .addSCodeImageFile(EditorStatusCodes.IMAGESUPLOAD_IMAGEUPL_HASCHANGED); 68 69 return; 69 70 } … … 72 73 if (suffix.equals(".jpg")) { 73 74 input 74 .addSCodeImageFile( StatusCodeLib.PFIXCORE_EDITOR_IMAGESUPLOAD_IMAGEUPL_WRONGTYPEJPG);75 .addSCodeImageFile(EditorStatusCodes.IMAGESUPLOAD_IMAGEUPL_WRONGTYPEJPG); 75 76 } else if (suffix.equals(".png")) { 76 77 input 77 .addSCodeImageFile( StatusCodeLib.PFIXCORE_EDITOR_IMAGESUPLOAD_IMAGEUPL_WRONGTYPEPNG);78 .addSCodeImageFile(EditorStatusCodes.IMAGESUPLOAD_IMAGEUPL_WRONGTYPEPNG); 78 79 } else if (suffix.equals(".gif")) { 79 80 input 80 .addSCodeImageFile( StatusCodeLib.PFIXCORE_EDITOR_IMAGESUPLOAD_IMAGEUPL_WRONGTYPEGIF);81 .addSCodeImageFile(EditorStatusCodes.IMAGESUPLOAD_IMAGEUPL_WRONGTYPEGIF); 81 82 } else { 82 83 input 83 .addSCodeImageFile( StatusCodeLib.PFIXCORE_EDITOR_IMAGESUPLOAD_IMAGEUPL_WRONGTYPE);84 .addSCodeImageFile(EditorStatusCodes.IMAGESUPLOAD_IMAGEUPL_WRONGTYPE); 84 85 } 85 86 } -
trunk/pfixcore/src/de/schlund/pfixcore/example/CounterHandler.java
r3447 r3542 24 24 import de.schlund.pfixcore.generator.IWrapper; 25 25 import de.schlund.pfixcore.workflow.Context; 26 import de.schlund.util.statuscodes.StatusCodeLib;27 26 28 27 /** -
trunk/pfixcore/src/de/schlund/pfixcore/example/CounterSetHandler.java
r3447 r3542 24 24 import de.schlund.pfixcore.generator.IWrapper; 25 25 import de.schlund.pfixcore.workflow.Context; 26 import de.schlund.util.statuscodes.StatusCodeLib;27 26 28 27 /** -
trunk/pfixcore/src/de/schlund/pfixcore/example/TShirtHandler.java
r3304 r3542 24 24 import de.schlund.pfixcore.generator.IWrapper; 25 25 import de.schlund.pfixcore.workflow.Context; 26 import de.schlund.util.statuscodes.StatusCodeLib;27 26 28 27 /** -
trunk/pfixcore/src/de/schlund/pfixcore/example/TrouserHandler.java
r3367 r3542 27 27 import de.schlund.pfixcore.generator.IWrapper; 28 28 import de.schlund.pfixcore.workflow.Context; 29 import de.schlund.util.statuscodes.StatusCodeLib;30 29 31 30 /** -
trunk/pfixcore/src/de/schlund/pfixcore/example/bank/ihandler/LoginHandler.java
r3473 r3542 4 4 import de.schlund.pfixcore.example.bank.AuthTokenManager; 5 5 import de.schlund.pfixcore.example.bank.BankApplication; 6 import de.schlund.pfixcore.example.bank.StatusCodeLib; 6 7 import de.schlund.pfixcore.example.bank.context.ContextAccount; 7 8 import de.schlund.pfixcore.example.bank.context.ContextCustomer; … … 13 14 import de.schlund.pfixcore.generator.IWrapper; 14 15 import de.schlund.pfixcore.workflow.Context; 15 import de.schlund.util.statuscodes.StatusCodeLib; 16 16 17 17 18 public class LoginHandler implements IHandler { -
trunk/pfixcore/src/de/schlund/pfixcore/example/iwrapper/AdultInfo.iwrp
r2278 r3542 5 5 <ihandler class="de.schlund.pfixcore.example.AdultInfoHandler"/> 6 6 7 <param name="Adult" type="java.lang.Boolean" missingscode=" pfixcore.example.home.AGE_MISSING">7 <param name="Adult" type="java.lang.Boolean" missingscode="de.schlund.pfixcore.example.StatusCodeLib#pfixcore.example.home.AGE_MISSING"> 8 8 <caster class="de.schlund.pfixcore.generator.casters.ToBoolean"> 9 <cparam name="scode_casterror" value=" pfixcore.example.home.NO_AGE"/>9 <cparam name="scode_casterror" value="de.schlund.pfixcore.example.StatusCodeLib#pfixcore.example.home.NO_AGE"/> 10 10 </caster> 11 11 </param> -
trunk/pfixcore/src/de/schlund/pfixcore/generator/IWrapperParam.java
r3367 r3542 26 26 27 27 import org.apache.log4j.Logger; 28 import org.pustefixframework.CoreStatusCodes; 28 29 29 30 import de.schlund.pfixxml.RequestParam; … … 31 32 import de.schlund.pfixxml.SimpleRequestParam; 32 33 import de.schlund.util.statuscodes.StatusCode; 33 import de.schlund.util.statuscodes.StatusCode Lib;34 import de.schlund.util.statuscodes.StatusCodeHelper; 34 35 35 36 /** … … 60 61 private HashSet<StatusCodeInfo> scodeinfos = new HashSet<StatusCodeInfo>(); 61 62 private Logger LOG = Logger.getLogger(this.getClass()); 62 private StatusCodeInfo missing = new StatusCodeInfo( StatusCodeLib.PFIXCORE_GENERATOR_MISSING_PARAM, null, null);63 private StatusCodeInfo missing = new StatusCodeInfo(CoreStatusCodes.MISSING_PARAM, null, null); 63 64 private boolean inrequest = false; 64 65 … … 104 105 105 106 public void setCustomSCode(String scode) { 106 missing = new StatusCodeInfo(StatusCodeLib.getStatusCodeByName(scode), null, null); 107 StatusCode sc = StatusCodeHelper.getStatusCodeByName(scode); 108 missing = new StatusCodeInfo(sc, null, null); 107 109 } 108 110 -
trunk/pfixcore/src/de/schlund/pfixcore/generator/casters/ToBoolean.java
r3367 r3542 21 21 import java.util.ArrayList; 22 22 23 import org.pustefixframework.CoreStatusCodes; 24 23 25 import de.schlund.pfixcore.generator.IWrapperParamCaster; 24 26 import de.schlund.pfixcore.generator.SimpleCheck; 25 27 import de.schlund.pfixxml.RequestParam; 26 28 import de.schlund.util.statuscodes.StatusCode; 27 import de.schlund.util.statuscodes.StatusCode Lib;29 import de.schlund.util.statuscodes.StatusCodeHelper; 28 30 29 31 /** … … 43 45 44 46 public ToBoolean() { 45 scode = StatusCodeLib.PFIXCORE_GENERATOR_CASTER_ERR_TO_BOOLEAN;47 scode = CoreStatusCodes.CASTER_ERR_TO_BOOLEAN; 46 48 } 47 49 48 50 public void put_scode_casterror(String fqscode) { 49 scode = StatusCode Lib.getStatusCodeByName(fqscode);51 scode = StatusCodeHelper.getStatusCodeByName(fqscode); 50 52 } 51 53 -
trunk/pfixcore/src/de/schlund/pfixcore/generator/casters/ToByte.java
r3367 r3542 21 21 import java.util.ArrayList; 22 22 23 import org.pustefixframework.CoreStatusCodes; 24 23 25 import de.schlund.pfixcore.generator.IWrapperParamCaster; 24 26 import de.schlund.pfixcore.generator.SimpleCheck; 25 27 import de.schlund.pfixxml.RequestParam; 26 28 import de.schlund.util.statuscodes.StatusCode; 27 import de.schlund.util.statuscodes.StatusCode Lib;29 import de.schlund.util.statuscodes.StatusCodeHelper; 28 30 29 31 /** … … 43 45 44 46 public ToByte() { 45 scode = StatusCodeLib.PFIXCORE_GENERATOR_CASTER_ERR_TO_BYTE;47 scode = CoreStatusCodes.CASTER_ERR_TO_BYTE; 46 48 } 47 49 48 50 public void put_scode_casterror(String fqscode) { 49 scode = StatusCode Lib.getStatusCodeByName(fqscode);51 scode = StatusCodeHelper.getStatusCodeByName(fqscode); 50 52 } 51 53 -
trunk/pfixcore/src/de/schlund/pfixcore/generator/casters/ToDate.java
r3367 r3542 24 24 import java.util.Date; 25 25 26 import org.pustefixframework.CoreStatusCodes; 27 26 28 import de.schlund.pfixcore.generator.IWrapperParamCaster; 27 29 import de.schlund.pfixcore.generator.SimpleCheck; 28 30 import de.schlund.pfixxml.RequestParam; 29 31 import de.schlund.util.statuscodes.StatusCode; 30 import de.schlund.util.statuscodes.StatusCode Lib;32 import de.schlund.util.statuscodes.StatusCodeHelper; 31 33 32 34 /** … … 47 49 48 50 public ToDate() { 49 scode = StatusCodeLib.PFIXCORE_GENERATOR_CASTER_ERR_TO_DATE;51 scode = CoreStatusCodes.CASTER_ERR_TO_DATE; 50 52 } 51 53 52 54 public void put_scode_casterror(String fqscode) { 53 scode = StatusCode Lib.getStatusCodeByName(fqscode);55 scode = StatusCodeHelper.getStatusCodeByName(fqscode); 54 56 } 55 57 -
trunk/pfixcore/src/de/schlund/pfixcore/generator/casters/ToDouble.java
r3367 r3542 21 21 import java.util.ArrayList; 22 22 23 import org.pustefixframework.CoreStatusCodes; 24 23 25 import de.schlund.pfixcore.generator.IWrapperParamCaster; 24 26 import de.schlund.pfixcore.generator.SimpleCheck; 25 27 import de.schlund.pfixxml.RequestParam; 26 28 import de.schlund.util.statuscodes.StatusCode; 27 import de.schlund.util.statuscodes.StatusCode Lib;29 import de.schlund.util.statuscodes.StatusCodeHelper; 28 30 29 31 /** … … 43 45 44 46 public ToDouble() { 45 scode = StatusCodeLib.PFIXCORE_GENERATOR_CASTER_ERR_TO_DOUBLE;47 scode = CoreStatusCodes.CASTER_ERR_TO_DOUBLE; 46 48 } 47 49 48 50 public void put_scode_casterror(String fqscode) { 49 scode = StatusCode Lib.getStatusCodeByName(fqscode);51 scode = StatusCodeHelper.getStatusCodeByName(fqscode); 50 52 } 51 53 -
trunk/pfixcore/src/de/schlund/pfixcore/generator/casters/ToFile.java
r3367 r3542 22 22 import java.util.ArrayList; 23 23 24 import org.pustefixframework.CoreStatusCodes; 25 24 26 import de.schlund.pfixcore.generator.IWrapperParamCaster; 25 27 import de.schlund.pfixcore.generator.SimpleCheck; … … 28 30 import de.schlund.pfixxml.multipart.FileData; 29 31 import de.schlund.util.statuscodes.StatusCode; 30 import de.schlund.util.statuscodes.StatusCode Lib;32 import de.schlund.util.statuscodes.StatusCodeHelper; 31 33 32 34 /** … … 44 46 45 47 public ToFile() { 46 scode = StatusCodeLib.PFIXCORE_GENERATOR_CASTER_ERR_TO_FILE;48 scode = CoreStatusCodes.CASTER_ERR_TO_FILE; 47 49 } 48 50 49 51 public void put_scode_casterror(String fqscode) { 50 scode = StatusCode Lib.getStatusCodeByName(fqscode);52 scode = StatusCodeHelper.getStatusCodeByName(fqscode); 51 53 } 52 54 -
trunk/pfixcore/src/de/schlund/pfixcore/generator/casters/ToFloat.java
r3367 r3542 21 21 import java.util.ArrayList; 22 22 23 import org.pustefixframework.CoreStatusCodes; 24 23 25 import de.schlund.pfixcore.generator.IWrapperParamCaster; 24 26 import de.schlund.pfixcore.generator.SimpleCheck; 25 27 import de.schlund.pfixxml.RequestParam; 26 28 import de.schlund.util.statuscodes.StatusCode; 27 import de.schlund.util.statuscodes.StatusCode Lib;29 import de.schlund.util.statuscodes.StatusCodeHelper; 28 30 29 31 /** … … 43 45 44 46 public ToFloat() { 45 scode = StatusCodeLib.PFIXCORE_GENERATOR_CASTER_ERR_TO_FLOAT;47 scode = CoreStatusCodes.CASTER_ERR_TO_FLOAT; 46 48 } 47 49 48 50 public void put_scode_casterror(String fqscode) { 49 scode = StatusCode Lib.getStatusCodeByName(fqscode);51 scode = StatusCodeHelper.getStatusCodeByName(fqscode); 50 52 } 51 53 -
trunk/pfixcore/src/de/schlund/pfixcore/generator/casters/ToInteger.java
r3367 r3542 21 21 import java.util.ArrayList; 22 22 23 import org.pustefixframework.CoreStatusCodes; 24 23 25 import de.schlund.pfixcore.generator.IWrapperParamCaster; 24 26 import de.schlund.pfixcore.generator.SimpleCheck; 25 27 import de.schlund.pfixxml.RequestParam; 26 28 import de.schlund.util.statuscodes.StatusCode; 27 import de.schlund.util.statuscodes.StatusCode Lib;29 import de.schlund.util.statuscodes.StatusCodeHelper; 28 30 29 31 /** … … 43 45 44 46 public ToInteger() { 45 scode = StatusCodeLib.PFIXCORE_GENERATOR_CASTER_ERR_TO_INTEGER;47 scode = CoreStatusCodes.CASTER_ERR_TO_INTEGER; 46 48 } 47 49 48 50 public void put_scode_casterror(String fqscode) { 49 scode = StatusCode Lib.getStatusCodeByName(fqscode);51 scode = StatusCodeHelper.getStatusCodeByName(fqscode); 50 52 } 51 53 -
trunk/pfixcore/src/de/schlund/pfixcore/generator/casters/ToLong.java
r3367 r3542 21 21 import java.util.ArrayList; 22 22 23 import org.pustefixframework.CoreStatusCodes; 24 23 25 import de.schlund.pfixcore.generator.IWrapperParamCaster; 24 26 import de.schlund.pfixcore.generator.SimpleCheck; 25 27 import de.schlund.pfixxml.RequestParam; 26 28 import de.schlund.util.statuscodes.StatusCode; 27 import de.schlund.util.statuscodes.StatusCode Lib;29 import de.schlund.util.statuscodes.StatusCodeHelper; 28 30 29 31 /** … … 43 45 44 46 public ToLong() { 45 scode = StatusCodeLib.PFIXCORE_GENERATOR_CASTER_ERR_TO_LONG;47 scode = CoreStatusCodes.CASTER_ERR_TO_LONG; 46 48 } 47 49 48 50 public void put_scode_casterror(String fqscode) { 49 scode = StatusCode Lib.getStatusCodeByName(fqscode);51 scode = StatusCodeHelper.getStatusCodeByName(fqscode); 50 52 } 51 53 -
trunk/pfixcore/src/de/schlund/pfixcore/generator/casters/ToPerl5Pattern.java
r3416 r3542 25 25 import org.apache.oro.text.regex.Perl5Compiler; 26 26 import org.apache.oro.text.regex.Perl5Pattern; 27 import org.pustefixframework.CoreStatusCodes; 27 28 28 29 import de.schlund.pfixcore.generator.IWrapperParamCaster; … … 30 31 import de.schlund.pfixxml.RequestParam; 31 32 import de.schlund.util.statuscodes.StatusCode; 32 import de.schlund.util.statuscodes.StatusCode Lib;33 import de.schlund.util.statuscodes.StatusCodeHelper; 33 34 34 35 … … 50 51 51 52 public ToPerl5Pattern() { 52 scode = StatusCodeLib.PFIXCORE_GENERATOR_CASTER_ERR_TO_P5PATTERN;53 scode = CoreStatusCodes.CASTER_ERR_TO_P5PATTERN; 53 54 } 54 55 55 56 public void put_scode_casterror(String fqscode) { 56 scode = StatusCode Lib.getStatusCodeByName(fqscode);57 scode = StatusCodeHelper.getStatusCodeByName(fqscode); 57 58 } 58 59 -
trunk/pfixcore/src/de/schlund/pfixcore/generator/casters/ToUploadFile.java
r3289 r3542 23 23 import java.util.List; 24 24 25 import org.pustefixframework.CoreStatusCodes; 26 25 27 import de.schlund.pfixcore.generator.IWrapperParamCaster; 26 28 import de.schlund.pfixcore.generator.SimpleCheck; … … 30 32 import de.schlund.pfixxml.multipart.UploadFile; 31 33 import de.schlund.util.statuscodes.StatusCode; 32 import de.schlund.util.statuscodes.StatusCode Lib;34 import de.schlund.util.statuscodes.StatusCodeHelper; 33 35 34 36 … … 39 41 40 42 public ToUploadFile() { 41 scode = StatusCodeLib.PFIXCORE_GENERATOR_CASTER_ERR_TO_UPLOADFILE;43 scode = CoreStatusCodes.CASTER_ERR_TO_UPLOADFILE; 42 44 } 43 45 44 46 public void put_scode_casterror(String fqscode) { 45 scode = StatusCode Lib.getStatusCodeByName(fqscode);47 scode = StatusCodeHelper.getStatusCodeByName(fqscode); 46 48 } 47 49 -
trunk/pfixcore/src/de/schlund/pfixcore/generator/postchecks/FloatRange.java
r3302 r3542 21 21 import java.util.StringTokenizer; 22 22 23 import org.pustefixframework.CoreStatusCodes; 24 23 25 import de.schlund.pfixcore.generator.IWrapperParamPostCheck; 24 26 import de.schlund.pfixcore.generator.SimpleCheck; 25 27 import de.schlund.util.statuscodes.StatusCode; 26 import de.schlund.util.statuscodes.StatusCode Lib;28 import de.schlund.util.statuscodes.StatusCodeHelper; 27 29 28 30 /** … … 46 48 47 49 public FloatRange() { 48 scode_small = StatusCodeLib.PFIXCORE_GENERATOR_POSTCHECK_FLOAT_TOO_SMALL;49 scode_big = StatusCodeLib.PFIXCORE_GENERATOR_POSTCHECK_FLOAT_TOO_BIG;50 scode_small = CoreStatusCodes.POSTCHECK_FLOAT_TOO_SMALL; 51 scode_big = CoreStatusCodes.POSTCHECK_FLOAT_TOO_BIG; 50 52 } 51 53 52 54 public void put_scode_too_small(String fqscode) { 53 scode_small = StatusCode Lib.getStatusCodeByName(fqscode);55 scode_small = StatusCodeHelper.getStatusCodeByName(fqscode); 54 56 } 55 57 56 58 public void put_scode_too_big(String fqscode) { 57 scode_big = StatusCode Lib.getStatusCodeByName(fqscode);59 scode_big = StatusCodeHelper.getStatusCodeByName(fqscode); 58 60 } 59 61 -
trunk/pfixcore/src/de/schlund/pfixcore/generator/postchecks/IntegerRange.java
r3302 r3542 21 21 import java.util.StringTokenizer; 22 22 23 import org.pustefixframework.CoreStatusCodes; 24 23 25 import de.schlund.pfixcore.generator.IWrapperParamPostCheck; 24 26 import de.schlund.pfixcore.generator.SimpleCheck; 25 27 import de.schlund.util.statuscodes.StatusCode; 26 import de.schlund.util.statuscodes.StatusCode Lib;28 import de.schlund.util.statuscodes.StatusCodeHelper; 27 29 28 30 /** … … 45 47 46 48 public IntegerRange() { 47 scode_small = StatusCodeLib.PFIXCORE_GENERATOR_POSTCHECK_INTEGER_TOO_SMALL;48 scode_big = StatusCodeLib.PFIXCORE_GENERATOR_POSTCHECK_INTEGER_TOO_BIG;49 scode_small = CoreStatusCodes.POSTCHECK_INTEGER_TOO_SMALL; 50 scode_big = CoreStatusCodes.POSTCHECK_INTEGER_TOO_BIG; 49 51 } 50 52 51 53 public void put_scode_too_small(String fqscode) { 52 scode_small = StatusCode Lib.getStatusCodeByName(fqscode);54 scode_small = StatusCodeHelper.getStatusCodeByName(fqscode); 53 55 } 54 56 55 57 public void put_scode_too_big(String fqscode) { 56 scode_big = StatusCode Lib.getStatusCodeByName(fqscode);58 scode_big = StatusCodeHelper.getStatusCodeByName(fqscode); 57 59 } 58 60 -
trunk/pfixcore/src/de/schlund/pfixcore/generator/postchecks/StringLength.java
r3418 r3542 19 19 package de.schlund.pfixcore.generator.postchecks; 20 20 21 import org.pustefixframework.CoreStatusCodes; 22 21 23 import de.schlund.pfixcore.generator.IWrapperParamPostCheck; 22 24 import de.schlund.pfixcore.generator.SimpleCheck; 23 25 import de.schlund.util.statuscodes.StatusCode; 24 import de.schlund.util.statuscodes.StatusCode Lib;26 import de.schlund.util.statuscodes.StatusCodeHelper; 25 27 26 28 /** … … 35 37 36 38 public StringLength () { 37 scTooShort = StatusCodeLib.PFIXCORE_GENERATOR_POSTCHECK_STRING_TOO_SHORT;38 scTooLong = StatusCodeLib.PFIXCORE_GENERATOR_POSTCHECK_STRING_TOO_LONG;39 scTooShort = CoreStatusCodes.POSTCHECK_STRING_TOO_SHORT; 40 scTooLong = CoreStatusCodes.POSTCHECK_STRING_TOO_LONG; 39 41 } 40 42 41 43 public void put_scode_too_long(String scode) { 42 scTooLong = StatusCode Lib.getStatusCodeByName(scode);44 scTooLong = StatusCodeHelper.getStatusCodeByName(scode); 43 45 } 44 46 45 47 public void put_scode_too_short(String scode) { 46 scTooShort = StatusCode Lib.getStatusCodeByName(scode);48 scTooShort = StatusCodeHelper.getStatusCodeByName(scode); 47 49 } 48 50 -
trunk/pfixcore/src/de/schlund/pfixcore/generator/prechecks/RegexpCheck.java
r3416 r3542 21 21 import org.apache.oro.text.PatternCacheLRU; 22 22 import org.apache.oro.text.perl.Perl5Util; 23 import org.pustefixframework.CoreStatusCodes; 23 24 24 25 import de.schlund.pfixcore.generator.IWrapperParamPreCheck; … … 26 27 import de.schlund.pfixxml.RequestParam; 27 28 import de.schlund.util.statuscodes.StatusCode; 28 import de.schlund.util.statuscodes.StatusCode Lib;29 import de.schlund.util.statuscodes.StatusCodeHelper; 29 30 30 31 /** … … 45 46 46 47 public RegexpCheck() { 47 scode = StatusCodeLib.PFIXCORE_GENERATOR_PRECHECK_REGEXP_NO_MATCH;48 scode = CoreStatusCodes.PRECHECK_REGEXP_NO_MATCH; 48 49 } 49 50 … … 53 54 54 55 public void put_scode_nomatch(String fqscode) { 55 scode = StatusCode Lib.getStatusCodeByName(fqscode);56 scode = StatusCodeHelper.getStatusCodeByName(fqscode); 56 57 } 57 58 -
trunk/pfixcore/src/de/schlund/pfixcore/lucefix/SearchHandler.java
r2332 r3542 24 24 import org.apache.lucene.queryParser.ParseException; 25 25 import org.apache.lucene.search.BooleanQuery; 26 import org.pustefixframework.editor.EditorStatusCodes; 26 27 27 28 import de.schlund.pfixcore.editor2.core.dom.Project; … … 32 33 import de.schlund.pfixcore.lucefix.wrappers.Search; 33 34 import de.schlund.pfixcore.workflow.Context; 34 import de.schlund.util.statuscodes.StatusCodeLib;35 35 36 36 public class SearchHandler implements IHandler { … … 56 56 csearch.search(content, tags, attribKey, attribValue, comments); 57 57 } catch (IOException e) { 58 search.addSCodeDoit( StatusCodeLib.PFIXCORE_LUCEFIX_INDEX_NOT_INITED);58 search.addSCodeDoit(EditorStatusCodes.LUCEFIX_INDEX_NOT_INITED); 59 59 } catch (BooleanQuery.TooManyClauses tmce) { 60 search.addSCodeDoit( StatusCodeLib.PFIXCORE_LUCEFIX_TOO_MANY_CLAUSES);60 search.addSCodeDoit(EditorStatusCodes.LUCEFIX_TOO_MANY_CLAUSES); 61 61 } 62 62 } -
trunk/pfixcore/src/de/schlund/pfixcore/testsuite/handler/Test5PageMessageHandler.java
r3520 r3542 21 21 import de.schlund.pfixcore.generator.IHandler; 22 22 import de.schlund.pfixcore.generator.IWrapper; 23 import de.schlund.pfixcore.testsuite.StatusCodeLib; 23 24 import de.schlund.pfixcore.workflow.Context; 24 import de.schlund.util.statuscodes.StatusCodeLib;25 25 26 26 public class Test5PageMessageHandler implements IHandler { -
trunk/pfixcore/src/de/schlund/pfixcore/util/GenerateSCodes.java
r3302 r3542 25 25 import java.io.OutputStreamWriter; 26 26 import java.io.Writer; 27 import java.util.ArrayList; 27 28 import java.util.HashSet; 29 import java.util.Iterator; 30 import java.util.List; 28 31 import java.util.Properties; 32 33 import javax.xml.parsers.DocumentBuilder; 34 import javax.xml.parsers.DocumentBuilderFactory; 29 35 30 36 import org.w3c.dom.Document; … … 33 39 import org.xml.sax.SAXException; 34 40 41 import de.schlund.pfixxml.config.GlobalConfig; 35 42 import de.schlund.pfixxml.config.GlobalConfigurator; 36 43 import de.schlund.pfixxml.config.XMLPropertiesUtil; … … 41 48 import de.schlund.util.statuscodes.StatusCode; 42 49 50 43 51 public class GenerateSCodes { 44 52 … … 46 54 47 55 public static void main(String[] args) throws Exception { 48 if (args.length != 3) { 49 throw new IOException("expected 3 arguments, got " + args.length); 50 } 51 52 //System.out.println("**** prop " + args[1]); 53 // Initialize PathFactory as it is needed by XMLPropertiesUtil 54 GlobalConfigurator.setDocroot(args[2]); 55 Properties tmp = new Properties(); 56 if (args[1].endsWith(".prop") || args[1].endsWith(".properties")) { 57 tmp.load(new FileInputStream(args[1])); 56 57 if (args.length != 4) { 58 throw new IOException("expected 4 arguments, got " + args.length); 59 } 60 61 File configFile = new File(args[0]); 62 String docroot = args[1]; 63 File genDir = new File(args[2]); 64 String className = args[3]; 65 GenerateSCodes.generate (configFile, docroot, genDir, className); 66 67 } 68 69 public static List<String> generateFromInfo(List<DocrootResource> infoFiles, String docRoot, File genDir) throws Exception { 70 List<String> allGenClasses = new ArrayList<String>(); 71 for(DocrootResource infoFile:infoFiles) { 72 List<String> genClasses = generate(infoFile, docRoot, genDir); 73 allGenClasses.addAll(genClasses); 74 } 75 return allGenClasses; 76 } 77 78 public static List<String> generate(DocrootResource infoFile, String docRoot, File genDir) throws Exception { 79 DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); 80 DocumentBuilder db = dbf.newDocumentBuilder(); 81 Document doc = db.parse(infoFile.getInputStream()); 82 NodeList scElems = doc.getDocumentElement().getElementsByTagName("statuscodes"); 83 List<String> genClasses = new ArrayList<String>(); 84 for(int i=0; i<scElems.getLength(); i++) { 85 Element scElem = (Element)scElems.item(i); 86 String className = scElem.getAttribute("class"); 87 List<DocrootResource> scXmlFiles = new ArrayList<DocrootResource>(); 88 NodeList fileElems = scElem.getElementsByTagName("file"); 89 for(int j=0; j<fileElems.getLength(); j++) { 90 Element fileElem = (Element)fileElems.item(j); 91 String filePath = fileElem.getTextContent(); 92 DocrootResource res = null; 93 if(!filePath.startsWith("/")) { 94 // try to get resource relative to info file 95 String path = infoFile.getRelativePath(); 96 path=path.substring(0,path.lastIndexOf('/'))+"/"+filePath; 97 DocrootResource tmp = ResourceUtil.getFileResourceFromDocroot(path); 98 if(tmp.exists()) res = tmp; 99 } 100 if(res==null) { 101 // try to get resource relative to docroot 102 DocrootResource tmp = ResourceUtil.getFileResourceFromDocroot(filePath); 103 if(tmp.exists()) res = tmp; 104 } 105 if(res==null) throw new RuntimeException("Statusmessage file not found: "+filePath); 106 scXmlFiles.add(res); 107 } 108 boolean generated = generate(scXmlFiles, docRoot, genDir, className); 109 if(generated) genClasses.add(className); 110 } 111 return genClasses; 112 } 113 114 115 116 public static void generate(File configFile, String docroot, File genDir, String className) throws IOException, SAXException { 117 GlobalConfigurator.setDocroot(docroot); 118 Properties props = new Properties(); 119 if (configFile.getName().endsWith(".prop") || configFile.getName().endsWith(".properties")) { 120 props.load(new FileInputStream(configFile)); 58 121 } else { 59 XMLPropertiesUtil.loadPropertiesFromXMLFile(new File(args[1]), tmp); 60 } 61 62 new GenerateSCodes (new File(args[0]), tmp, args[2]).run(); 63 } 64 65 File dest; 66 HashSet<DocrootResource> scfiles; 67 String docroot; 68 69 70 public GenerateSCodes(File dest, Properties prop, String docroot) throws IOException { 71 this.dest = dest; 72 this.docroot = docroot; 73 74 scfiles = new HashSet<DocrootResource>(); 75 76 HashSet<String> propfiles = new HashSet<String>(PropertiesUtils.selectProperties(prop, SCODEFILES).values()); 77 122 XMLPropertiesUtil.loadPropertiesFromXMLFile(configFile, props); 123 } 124 generate(props, docroot, genDir, className); 125 } 126 127 public static void generate(Properties props, String docroot, File genDir, String className) throws IOException, SAXException { 128 if(GlobalConfig.getDocroot()==null) GlobalConfigurator.setDocroot(docroot); 129 130 HashSet<DocrootResource> scfiles = new HashSet<DocrootResource>(); 131 HashSet<String> propfiles = new HashSet<String>(PropertiesUtils.selectProperties(props, SCODEFILES).values()); 78 132 for (String tmp: propfiles) { 79 //System.out.println("**** scfile: " + tmp);80 133 scfiles.add(ResourceUtil.getFileResourceFromDocroot(tmp)); 81 134 } 82 }83 84 85 86 public void run() throws IOException, SAXException {87 boolean dogen = false;88 long targetmodtime = -1;89 90 //System.out.println("**** " + dest.getCanonicalPath());91 92 if (dest.exists()) {93 targetmodtime = dest.lastModified();135 136 String scLibPath = className.replace('.','/')+".java"; 137 File scLibFile = new File(genDir, scLibPath); 138 if (scLibFile.exists()) { 139 boolean newer = false; 140 for (FileResource path: scfiles) { 141 if (path.exists() && path.lastModified() > scLibFile.lastModified()) { 142 newer = true; 143 break; 144 } 145 } 146 if(!newer) return; 94 147 } else { 95 if (!dest.getParentFile().exists()) { 96 dest.getParentFile().mkdirs(); 97 } 98 } 99 100 101 for (FileResource path: scfiles) { 102 //System.out.println("**** look at " + tmp.getCanonicalPath()); 103 if (path.exists() && path.lastModified() > targetmodtime) { 104 dogen = true; 105 break; 106 } 107 } 108 109 //System.out.println("**** dogen is " + dogen); 110 111 if (dogen) { 112 113 Writer writer = new OutputStreamWriter(new FileOutputStream(dest), "ascii"); 114 createHeader(writer); 115 116 for (DocrootResource input: scfiles) { 117 Document doc = Xml.parseMutable(input); 118 NodeList list = doc.getElementsByTagName("part"); 119 for (int i = 0; i < list.getLength() ; i++) { 120 Element node = (Element) list.item(i); 121 String name = node.getAttribute("name"); 122 String classname = StatusCode.convertToFieldName(name); 123 writer.write(" public static final StatusCode " + classname + 124 " = new StatusCode(\"" + name + "\", ResourceUtil.getFileResourceFromDocroot(\"" + input.getRelativePath() + "\"));\n"); 148 if (!scLibFile.getParentFile().exists()) { 149 scLibFile.getParentFile().mkdirs(); 150 } 151 } 152 153 Writer writer = new OutputStreamWriter(new FileOutputStream(scLibFile), "ascii"); 154 createHeader(writer, className); 155 156 List<String> docRelPaths = new ArrayList<String>(); 157 for (DocrootResource input: scfiles) docRelPaths.add(input.getRelativePath()); 158 createResources(writer, docRelPaths); 159 160 for (DocrootResource input: scfiles) { 161 Document doc = Xml.parseMutable(input); 162 createStatusCodes(writer, doc, docRelPaths.indexOf(input.getRelativePath())); 163 } 164 165 writer.write("}\n"); 166 writer.flush(); 167 writer.close(); 168 169 } 170 171 public static boolean generate(List<DocrootResource> scXmlFiles, String docroot, File genDir, String className) throws IOException, SAXException { 172 173 if(GlobalConfig.getDocroot()==null) GlobalConfigurator.setDocroot(docroot); 174 175 String scLibPath = className.replace('.','/')+".java"; 176 File scLibFile = new File(genDir, scLibPath); 177 if (scLibFile.exists()) { 178 boolean newer = false; 179 for (FileResource path: scXmlFiles) { 180 if (path.exists() && path.lastModified() > scLibFile.lastModified()) { 181 newer = true; 182 break; 125 183 } 126 184 } 127 128 writer.write("}\n"); 129 writer.flush(); 130 writer.close(); 131 } 132 } 133 134 private void createHeader(Writer writer) throws IOException { 185 if(!newer) return false; 186 } else { 187 if (!scLibFile.getParentFile().exists()) { 188 scLibFile.getParentFile().mkdirs(); 189 } 190 } 191 192 Writer writer = new OutputStreamWriter(new FileOutputStream(scLibFile), "ascii"); 193 createHeader(writer, className); 194 195 List<String> docRelPaths = new ArrayList<String>(); 196 for (DocrootResource input: scXmlFiles) docRelPaths.add(input.getRelativePath()); 197 createResources(writer, docRelPaths); 198 199 for (DocrootResource input: scXmlFiles) { 200 Document doc = Xml.parseMutable(input); 201 createStatusCodes(writer, doc, docRelPaths.indexOf(input.getRelativePath())); 202 } 203 204 writer.write("}\n"); 205 writer.flush(); 206 writer.close(); 207 208 return true; 209 } 210 211 public static void generate(File scXmlFile, File genDir, String className, String docRelPath) throws IOException, SAXException { 212 213 if (!scXmlFile.exists()) throw new IOException("statuscode file doesn't exist: "+scXmlFile.getAbsolutePath()); 214 215 String scLibPath = className.replace('.','/')+".java"; 216 File scLibFile = new File(genDir, scLibPath); 217 if (scLibFile.exists()) { 218 if(scXmlFile.lastModified() < scLibFile.lastModified()) return; 219 } else { 220 if (!scLibFile.getParentFile().exists()) { 221 scLibFile.getParentFile().mkdirs(); 222 } 223 } 224 225 Writer writer = new OutputStreamWriter(new FileOutputStream(scLibFile), "ascii"); 226 createHeader(writer, className); 227 228 List<String> docRelPaths = new ArrayList<String>(); 229 docRelPaths.add(docRelPath); 230 createResources(writer, docRelPaths); 231 232 Document doc = Xml.parseMutable(scXmlFile); 233 createStatusCodes(writer, doc, 0); 234 235 writer.write("\n}\n"); 236 writer.flush(); 237 writer.close(); 238 239 } 240 241 private static void createResources(Writer writer, List<String> docRelPaths) throws IOException { 242 writer.write(" public static final DocrootResource[] __RES = {\n"); 243 Iterator<String> it = docRelPaths.iterator(); 244 while(it.hasNext()) { 245 writer.write(" ResourceUtil.getFileResourceFromDocroot(\""+it.next()+"\")"); 246 if(it.hasNext()) writer.write(","); 247 writer.write("\n"); 248 } 249 writer.write(" };\n\n"); 250 } 251 252 private static void createStatusCodes(Writer writer, Document doc, int resIndex) throws IOException { 253 NodeList list = doc.getElementsByTagName("part"); 254 for (int i = 0; i < list.getLength() ; i++) { 255 Element node = (Element) list.item(i); 256 String name = node.getAttribute("name"); 257 String classname = StatusCode.convertToFieldName(name); 258 writer.write(" public static final StatusCode " + classname + 259 " = new StatusCode(\"" + name + "\", __RES["+resIndex+"]);\n"); 260 } 261 } 262 263 private static void createHeader(Writer writer, String className) throws IOException { 264 int ind = className.lastIndexOf('.'); 265 if(ind == -1) throw new RuntimeException("Class name must contain package: "+className); 266 String pkgName = className.substring(0,ind); 267 String simpleName = className.substring(ind+1); 135 268 writer.write("/*\n"); 136 269 writer.write(" * This file is AUTOGENERATED. Do not change by hand.\n"); … … 138 271 writer.write("\n"); 139 272 writer.write("\n"); 140 writer.write("package de.schlund.util.statuscodes;\n"); 273 writer.write("package "+pkgName+";\n\n"); 274 writer.write("import de.schlund.pfixxml.resources.DocrootResource;\n"); 141 275 writer.write("import de.schlund.pfixxml.resources.ResourceUtil;\n"); 276 if(!pkgName.equals("de.schlund.util.statuscodes")) { 277 writer.write("import de.schlund.util.statuscodes.StatusCode;\n"); 278 writer.write("import de.schlund.util.statuscodes.StatusCodeException;\n"); 279 } 142 280 writer.write("import java.lang.reflect.Field;\n"); 143 281 writer.write("\n"); 144 writer.write("public class StatusCodeLib {\n");282 writer.write("public class "+simpleName+" {\n\n"); 145 283 writer.write(" public static StatusCode getStatusCodeByName(String name) throws StatusCodeException {\n"); 146 284 writer.write(" return getStatusCodeByName(name, false);\n"); … … 151 289 writer.write(" StatusCode scode = null;\n"); 152 290 writer.write(" try {\n"); 153 writer.write(" Field field = StatusCodeLib.class.getField(fieldname);\n");291 writer.write(" Field field = "+simpleName+".class.getField(fieldname);\n"); 154 292 writer.write(" scode = (StatusCode) field.get(null);\n"); 155 293 writer.write(" } catch (NoSuchFieldException e) {\n"); … … 164 302 writer.write(" }\n"); 165 303 writer.write(" return scode;\n"); 166 writer.write(" }\n ");304 writer.write(" }\n\n"); 167 305 } 168 306 -
trunk/pfixcore/src/de/schlund/pfixcore/workflow/app/DefaultIWrapperState.java
r3520 r3542 19 19 20 20 package de.schlund.pfixcore.workflow.app; 21 22 import org.pustefixframework.CoreStatusCodes; 21 23 22 24 import de.schlund.pfixcore.util.TokenManager; … … 31 33 import de.schlund.pfixxml.perflogging.PerfEvent; 32 34 import de.schlund.pfixxml.perflogging.PerfEventType; 33 import de.schlund.util.statuscodes.StatusCodeLib;34 35 35 36 /** … … 105 106 tm.invalidateToken(tokenName); 106 107 } else { 107 context.addPageMessage( StatusCodeLib.PFIXCORE_GENERATOR_FORM_TOKEN_INVALID, null, null);108 context.addPageMessage(CoreStatusCodes.FORM_TOKEN_INVALID, null, null); 108 109 if (errorPage.equals("")) { 109 110 pe = new PerfEvent(PerfEventType.PAGE_RETRIEVECURRENTSTATUS, context.getCurrentPageRequest().toString()); … … 124 125 PageRequestConfig pageConf = context.getConfigForCurrentPageRequest(); 125 126 if (pageConf != null && pageConf.requiresToken()) { 126 context.addPageMessage( StatusCodeLib.PFIXCORE_GENERATOR_FORM_TOKEN_MISSING, null, null);127 context.addPageMessage(CoreStatusCodes.FORM_TOKEN_MISSING, null, null); 127 128 pe = new PerfEvent(PerfEventType.PAGE_RETRIEVECURRENTSTATUS, context.getCurrentPageRequest().toString()); 128 129 pe.start(); -
trunk/pfixcore/src/de/schlund/util/statuscodes/StatusCode.java
r2825 r3542 26 26 private final DocrootResource path; 27 27 28 p rotectedStatusCode(String part, DocrootResource path) {28 public StatusCode(String part, DocrootResource path) { 29 29 this.part = part; 30 30 this.path = path;
