This commit is contained in:
Victor Bellavin
2015-03-01 22:17:02 +03:00
commit 680eab32ed
41 changed files with 1225 additions and 0 deletions

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
*.bat text eol=crlf

9
.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
.gradle
build
logs
gen
.idea/libraries/Gradle__*.xml
.idea/workspace.xml
.idea/misc.xml
ncore-properties-local.xml
*.iml

1
.idea/.name generated Normal file
View File

@ -0,0 +1 @@
sample

62
.idea/codeStyleSettings.xml generated Normal file
View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectCodeStyleSettingsManager">
<option name="PER_PROJECT_SETTINGS">
<value>
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value />
</option>
<option name="IMPORT_LAYOUT_TABLE">
<value>
<package name="biz.redsoft" withSubpackages="true" static="false" />
<package name="biz.red_soft" withSubpackages="true" static="false" />
<emptyLine />
<package name="java" withSubpackages="true" static="false" />
<emptyLine />
<package name="javax" withSubpackages="true" static="false" />
<emptyLine />
<package name="org" withSubpackages="true" static="false" />
<emptyLine />
<package name="" withSubpackages="true" static="false" />
<emptyLine />
<package name="" withSubpackages="true" static="true" />
</value>
</option>
<option name="FORMATTER_TAGS_ENABLED" value="true" />
<XML>
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
<codeStyleSettings language="JAVA">
<option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="1" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_LIST_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_WRAP" value="1" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="ASSERT_STATEMENT_WRAP" value="1" />
<option name="VARIABLE_ANNOTATION_WRAP" value="2" />
<option name="ENUM_CONSTANTS_WRAP" value="2" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="XML">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
</codeStyleSettings>
</value>
</option>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Red" />
</component>
</project>

22
.idea/compiler.xml generated Normal file
View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>

9
.idea/copyright/RedSoft.xml generated Normal file
View File

@ -0,0 +1,9 @@
<component name="CopyrightManager">
<copyright>
<option name="notice" value="Copyright (C) &amp;#36;today.year Red Soft Corporation.&#13;&#10;&#13;&#10;This file is part of Red nCore.&#13;&#10;&#13;&#10;Red nCore is free software; you can redistribute it and/or modify&#13;&#10;it under the terms of the GNU General Public License as published by&#13;&#10;the Free Software Foundation; either version 2, or (at your option)&#13;&#10;any later version.&#13;&#10;&#13;&#10;Red nCore is distributed in the hope that it will be useful, but&#13;&#10;WITHOUT ANY WARRANTY; without even the implied warranty of&#13;&#10;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU&#13;&#10;General Public License for more details.&#13;&#10;&#13;&#10;You should have received a copy of the GNU General Public License&#13;&#10;along with Red nCore; see the file COPYING. If not, write to the&#13;&#10;Red Soft Corporation, 117105, Russia, Moscow, Nagornyy proyezd, 5.&#13;&#10;&#13;&#10;Linking this library statically or dynamically with other modules is&#13;&#10;making a combined work based on this library. Thus, the terms and&#13;&#10;conditions of the GNU General Public License cover the whole&#13;&#10;combination.&#13;&#10;&#13;&#10;As a special exception, the copyright holders of this library give you&#13;&#10;permission to link this library with independent modules to produce an&#13;&#10;executable, regardless of the license terms of these independent&#13;&#10;modules, and to copy and distribute the resulting executable under&#13;&#10;terms of your choice, provided that you also meet, for each linked&#13;&#10;independent module, the terms and conditions of the license of that&#13;&#10;module. An independent module is a module which is not derived from&#13;&#10;or based on this library. If you modify this library, you may extend&#13;&#10;this exception to your version of the library, but you are not&#13;&#10;obligated to do so. If you do not wish to do so, delete this&#13;&#10;exception statement from your version." />
<option name="keyword" value="Copyright" />
<option name="allowReplaceKeyword" value="RedSoft" />
<option name="myName" value="RedSoft" />
<option name="myLocal" value="true" />
</copyright>
</component>

7
.idea/copyright/profiles_settings.xml generated Normal file
View File

@ -0,0 +1,7 @@
<component name="CopyrightManager">
<settings default="RedSoft">
<module2copyright>
<element module="All" copyright="RedSoft" />
</module2copyright>
</settings>
</component>

9
.idea/encodings.xml generated Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false">
<file url="file://$PROJECT_DIR$/.idea/copyright/RedSoft.xml" charset="windows-1251" />
<file url="file://$PROJECT_DIR$/.idea/copyright/profiles_settings.xml" charset="windows-1251" />
<file url="file://$PROJECT_DIR$/src/main/webapp/META-INF" charset="windows-1251" />
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

220
.idea/findbugs-idea.xml generated Normal file
View File

@ -0,0 +1,220 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="org.twodividedbyzero.idea.findbugs">
<option name="annotationTypeSettings">
<map>
<entry key="ExpPriority" value="-4473925;-12828863;-8355712;WAVE_UNDERSCORE;0;" />
<entry key="HighPriority" value="-39836;-12828863;-39836;WAVE_UNDERSCORE;1;" />
<entry key="IgnorePriority" value="-4473925;-12828863;-11978414;WAVE_UNDERSCORE;0;" />
<entry key="LowPriority" value="-4473925;-12828863;-10316203;BOXED;0;" />
<entry key="NormalPriority" value="-4473925;-12828863;-10461184;WAVE_UNDERSCORE;2;" />
</map>
</option>
<option name="_basePreferences">
<map>
<entry key="property.analysisEffortLevel" value="default" />
<entry key="property.analyzeAfterCompile" value="false" />
<entry key="property.annotationGutterIconEnabled" value="true" />
<entry key="property.annotationSuppressWarningsClass" value="edu.umd.cs.findbugs.annotations.SuppressFBWarnings" />
<entry key="property.annotationTextRangeMarkupEnabled" value="true" />
<entry key="property.exportAsHtml" value="true" />
<entry key="property.exportAsXml" value="true" />
<entry key="property.exportBaseDir" value="" />
<entry key="property.exportCreateArchiveDir" value="false" />
<entry key="property.exportOpenBrowser" value="true" />
<entry key="property.minPriorityToReport" value="Medium" />
<entry key="property.runAnalysisInBackground" value="false" />
<entry key="property.showHiddenDetectors" value="false" />
<entry key="property.toolWindowToFront" value="true" />
</map>
</option>
<option name="_detectors">
<map>
<entry key="AppendingToAnObjectOutputStream" value="true" />
<entry key="AtomicityProblem" value="true" />
<entry key="BadAppletConstructor" value="false" />
<entry key="BadResultSetAccess" value="true" />
<entry key="BadSyntaxForRegularExpression" value="true" />
<entry key="BadUseOfReturnValue" value="true" />
<entry key="BadlyOverriddenAdapter" value="true" />
<entry key="BooleanReturnNull" value="true" />
<entry key="BuildInterproceduralCallGraph" value="false" />
<entry key="BuildObligationPolicyDatabase" value="true" />
<entry key="BuildStringPassthruGraph" value="true" />
<entry key="CallToUnsupportedMethod" value="false" />
<entry key="CalledMethods" value="true" />
<entry key="CheckCalls" value="false" />
<entry key="CheckExpectedWarnings" value="false" />
<entry key="CheckImmutableAnnotation" value="true" />
<entry key="CheckRelaxingNullnessAnnotation" value="true" />
<entry key="CheckTypeQualifiers" value="true" />
<entry key="CloneIdiom" value="true" />
<entry key="ComparatorIdiom" value="true" />
<entry key="ConfusedInheritance" value="true" />
<entry key="ConfusionBetweenInheritedAndOuterMethod" value="true" />
<entry key="CrossSiteScripting" value="true" />
<entry key="DefaultEncodingDetector" value="true" />
<entry key="DoInsideDoPrivileged" value="true" />
<entry key="DontCatchIllegalMonitorStateException" value="true" />
<entry key="DontIgnoreResultOfPutIfAbsent" value="true" />
<entry key="DontUseEnum" value="true" />
<entry key="DroppedException" value="true" />
<entry key="DumbMethodInvocations" value="true" />
<entry key="DumbMethods" value="true" />
<entry key="DuplicateBranches" value="true" />
<entry key="EmptyZipFileEntry" value="false" />
<entry key="EqualsOperandShouldHaveClassCompatibleWithThis" value="true" />
<entry key="ExplicitSerialization" value="true" />
<entry key="FieldItemSummary" value="true" />
<entry key="FinalizerNullsFields" value="true" />
<entry key="FindBadCast2" value="true" />
<entry key="FindBadForLoop" value="true" />
<entry key="FindBugsSummaryStats" value="true" />
<entry key="FindCircularDependencies" value="false" />
<entry key="FindDeadLocalStores" value="true" />
<entry key="FindDoubleCheck" value="true" />
<entry key="FindEmptySynchronizedBlock" value="true" />
<entry key="FindFieldSelfAssignment" value="true" />
<entry key="FindFinalizeInvocations" value="true" />
<entry key="FindFloatEquality" value="true" />
<entry key="FindFloatMath" value="false" />
<entry key="FindHEmismatch" value="true" />
<entry key="FindInconsistentSync2" value="true" />
<entry key="FindJSR166LockMonitorenter" value="true" />
<entry key="FindLocalSelfAssignment2" value="true" />
<entry key="FindMaskedFields" value="true" />
<entry key="FindMismatchedWaitOrNotify" value="true" />
<entry key="FindNakedNotify" value="true" />
<entry key="FindNoSideEffectMethods" value="true" />
<entry key="FindNonSerializableStoreIntoSession" value="false" />
<entry key="FindNonSerializableValuePassedToWriteObject" value="false" />
<entry key="FindNonShortCircuit" value="true" />
<entry key="FindNullDeref" value="true" />
<entry key="FindNullDerefsInvolvingNonShortCircuitEvaluation" value="true" />
<entry key="FindOpenStream" value="true" />
<entry key="FindPuzzlers" value="true" />
<entry key="FindRefComparison" value="true" />
<entry key="FindReturnRef" value="true" />
<entry key="FindRoughConstants" value="true" />
<entry key="FindRunInvocations" value="true" />
<entry key="FindSelfComparison" value="true" />
<entry key="FindSelfComparison2" value="true" />
<entry key="FindSleepWithLockHeld" value="true" />
<entry key="FindSpinLoop" value="true" />
<entry key="FindSqlInjection" value="true" />
<entry key="FindTwoLockWait" value="true" />
<entry key="FindUncalledPrivateMethods" value="true" />
<entry key="FindUnconditionalWait" value="true" />
<entry key="FindUninitializedGet" value="true" />
<entry key="FindUnrelatedTypesInGenericContainer" value="true" />
<entry key="FindUnreleasedLock" value="true" />
<entry key="FindUnsatisfiedObligation" value="true" />
<entry key="FindUnsyncGet" value="true" />
<entry key="FindUseOfNonSerializableValue" value="true" />
<entry key="FindUselessControlFlow" value="true" />
<entry key="FormatStringChecker" value="true" />
<entry key="FunctionsThatMightBeMistakenForProcedures" value="true" />
<entry key="HugeSharedStringConstants" value="true" />
<entry key="IDivResultCastToDouble" value="true" />
<entry key="IncompatMask" value="true" />
<entry key="InconsistentAnnotations" value="true" />
<entry key="InefficientIndexOf" value="true" />
<entry key="InefficientInitializationInsideLoop" value="true" />
<entry key="InefficientMemberAccess" value="false" />
<entry key="InefficientToArray" value="true" />
<entry key="InfiniteLoop" value="true" />
<entry key="InfiniteRecursiveLoop" value="true" />
<entry key="InheritanceUnsafeGetResource" value="true" />
<entry key="InitializationChain" value="true" />
<entry key="InitializeNonnullFieldsInConstructor" value="true" />
<entry key="InstantiateStaticClass" value="true" />
<entry key="IntCast2LongAsInstant" value="true" />
<entry key="InvalidJUnitTest" value="true" />
<entry key="IteratorIdioms" value="true" />
<entry key="LazyInit" value="true" />
<entry key="LoadOfKnownNullValue" value="true" />
<entry key="LostLoggerDueToWeakReference" value="true" />
<entry key="MethodReturnCheck" value="true" />
<entry key="Methods" value="true" />
<entry key="MultithreadedInstanceAccess" value="true" />
<entry key="MutableLock" value="true" />
<entry key="MutableStaticFields" value="true" />
<entry key="Naming" value="true" />
<entry key="Noise" value="false" />
<entry key="NoiseNullDeref" value="false" />
<entry key="NoteAnnotationRetention" value="true" />
<entry key="NoteCheckReturnValueAnnotations" value="true" />
<entry key="NoteDirectlyRelevantTypeQualifiers" value="true" />
<entry key="NoteJCIPAnnotation" value="true" />
<entry key="NoteNonNullAnnotations" value="false" />
<entry key="NoteNonnullReturnValues" value="false" />
<entry key="NoteSuppressedWarnings" value="true" />
<entry key="NoteUnconditionalParamDerefs" value="true" />
<entry key="NumberConstructor" value="true" />
<entry key="OptionalReturnNull" value="true" />
<entry key="OverridingEqualsNotSymmetrical" value="true" />
<entry key="PreferZeroLengthArrays" value="true" />
<entry key="PublicSemaphores" value="false" />
<entry key="QuestionableBooleanAssignment" value="true" />
<entry key="ReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass" value="true" />
<entry key="ReadReturnShouldBeChecked" value="true" />
<entry key="RedundantInterfaces" value="true" />
<entry key="ReflectiveClasses" value="true" />
<entry key="RepeatedConditionals" value="true" />
<entry key="ResolveAllReferences" value="false" />
<entry key="RuntimeExceptionCapture" value="true" />
<entry key="SerializableIdiom" value="true" />
<entry key="StartInConstructor" value="true" />
<entry key="StaticCalendarDetector" value="true" />
<entry key="StringConcatenation" value="true" />
<entry key="SuperfluousInstanceOf" value="true" />
<entry key="SuspiciousThreadInterrupted" value="true" />
<entry key="SwitchFallthrough" value="true" />
<entry key="SynchronizationOnSharedBuiltinConstant" value="true" />
<entry key="SynchronizeAndNullCheckField" value="true" />
<entry key="SynchronizeOnClassLiteralNotGetClass" value="true" />
<entry key="SynchronizingOnContentsOfFieldToProtectField" value="true" />
<entry key="TestASM" value="false" />
<entry key="TestDataflowAnalysis" value="false" />
<entry key="TestingGround" value="false" />
<entry key="TestingGround2" value="false" />
<entry key="TrainFieldStoreTypes" value="true" />
<entry key="TrainLongInstantfParams" value="true" />
<entry key="TrainNonNullAnnotations" value="true" />
<entry key="TrainUnconditionalDerefParams" value="true" />
<entry key="URLProblems" value="true" />
<entry key="UncallableMethodOfAnonymousClass" value="true" />
<entry key="UnnecessaryMath" value="true" />
<entry key="UnreadFields" value="true" />
<entry key="UselessSubclassMethod" value="false" />
<entry key="VarArgsProblems" value="true" />
<entry key="VolatileUsage" value="true" />
<entry key="WaitInLoop" value="true" />
<entry key="WrongMapIterator" value="true" />
<entry key="XMLFactoryBypass" value="true" />
</map>
</option>
<option name="_reportCategories">
<map>
<entry key="BAD_PRACTICE" value="true" />
<entry key="CORRECTNESS" value="true" />
<entry key="EXPERIMENTAL" value="true" />
<entry key="I18N" value="true" />
<entry key="MALICIOUS_CODE" value="true" />
<entry key="MT_CORRECTNESS" value="true" />
<entry key="PERFORMANCE" value="true" />
<entry key="SECURITY" value="true" />
<entry key="STYLE" value="true" />
</map>
</option>
<option name="_annotationTypeSettings">
<map>
<entry key="ExpPriority" value="-4473925;-12828863;-8355712;WAVE_UNDERSCORE;0;" />
<entry key="HighPriority" value="-39836;-12828863;-39836;WAVE_UNDERSCORE;1;" />
<entry key="IgnorePriority" value="-4473925;-12828863;-11978414;WAVE_UNDERSCORE;0;" />
<entry key="LowPriority" value="-4473925;-12828863;-10316203;BOXED;0;" />
<entry key="NormalPriority" value="-4473925;-12828863;-10461184;WAVE_UNDERSCORE;2;" />
</map>
</option>
</component>
</project>

16
.idea/gradle.xml generated Normal file
View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>

8
.idea/modules.xml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/sample.iml" filepath="$PROJECT_DIR$/sample.iml" />
</modules>
</component>
</project>

5
.idea/scopes/scope_settings.xml generated Normal file
View File

@ -0,0 +1,5 @@
<component name="DependencyValidationManager">
<state>
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
</state>
</component>

124
.idea/uiDesigner.xml generated Normal file
View File

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

6
.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>

1
.java-version Normal file
View File

@ -0,0 +1 @@
1.6.0.45

42
README.md Normal file
View File

@ -0,0 +1,42 @@
Пример проекта на платформе ncore
====================
Здесь представлена стандартная структура проекта с основными конфигурационными
файлами и классами, а также настройки IDE (Intellij Idea) и настройки SCM (git).
Для данного проекта можно использовать базу ядра.
Таски запускаются с помощью gradle wrapper. Версия Gradle - 2.2.1.
Nix
```bash
./gradlew build
```
Win
```
gradlew.bat build
```
__Основные таски__
* ncoreLoadPatches - загрузка патчей
* ncoreApplyPatches - применение патчей
* ncoreUpdateDb - загрузка и применение патчей
* generateSources - генерация исходников
* classes - компиляция
* build - компиляция, выполнение проверок (тесты)
* distZip - генерация zip-архива дистрибутива толстого клиента (build/distributions)
* war - генерация war-архива тонкого клиента (build/libs)
* release - выпуск сборки
Если нужно выполнить компиляцию классов, но при этом не запускать генерацию кода, можно воспользоваться ключом -x.
```bash
./gradlew classes -x generateSources
```
Названия тасков можно сокращать. Например, вместо generateSources можно указать gS, вместо ncoreLoadPatches nLP и т.д.

76
build.gradle Normal file
View File

@ -0,0 +1,76 @@
buildscript {
repositories {
maven { url 'http://nexus.red-soft.biz/nexus/content/groups/public' }
}
dependencies {
classpath 'biz.redsoft.gradle.ncore:gradle-ncore:+'
}
}
group = 'biz.redsoft.sample'
apply plugin: 'application'
apply plugin: 'war'
apply plugin: 'ncore'
apply plugin: 'maven-publish'
targetCompatibility = 1.6
ncore {
coreVersion = '1.2.18.1'
coreJarsigned = true
sourceEncoding = 'UTF-8'
}
dependencies {
provided 'javax.servlet:javax.servlet-api:3.0.1'
testCompile 'junit:junit:4.+'
}
publishing {
repositories {
project.hasProperty('biz.redsoft.repo.user') && project.hasProperty('biz.redsoft.repo.password') && maven {
credentials {
username project.'biz.redsoft.repo.user'
password project.'biz.redsoft.repo.password'
}
def suffix = project.version.toString().endsWith('SNAPSHOT') ? 'snapshots' : 'releases'
url "http://nexus.red-soft.biz/nexus/content/repositories/${suffix}"
}
}
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourceJar
artifact updatesJar
}
mavenJavaGen(MavenPublication) {
artifactId "${genJar.baseName}-${genJar.appendix}"
artifact genJar
artifact genSourceJar
}
}
}
task copyDist(type: Copy) {
from distZip
from war
def releaseDir
if (project.hasProperty('biz.redsoft.release.dir') && project.getProperty('biz.redsoft.release.dir'))
releaseDir = "${project.getProperty('biz.redsoft.release.dir')}"
else
releaseDir = "$projectDir/../releases"
into "$releaseDir/$project.name/$version"
}
release {
tagPrefix = 'v'
}
task buildRelease(type: GradleBuild) {
tasks = ['clean', 'writeVersion', 'nbackup', 'build', 'copyDist', 'publish']
}

BIN
gradle/wrapper/gradle-wrapper.jar vendored Normal file

Binary file not shown.

View File

@ -0,0 +1,6 @@
#Sun Mar 01 21:29:45 MSK 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip

164
gradlew vendored Executable file
View File

@ -0,0 +1,164 @@
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

90
gradlew.bat vendored Normal file
View File

@ -0,0 +1,90 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

26
log4j.properties Normal file
View File

@ -0,0 +1,26 @@
log4j.rootLogger=DEBUG, file, stdout
log4j.logger.biz.redsoft.ncore.docflow.Log4jDocFlowLogger=INFO, biz.redsoft.ncore.docflow.Log4jDocFlowLogger
log4j.appender.biz.redsoft.ncore.docflow.Log4jDocFlowLogger=org.apache.log4j.FileAppender
log4j.appender.biz.redsoft.ncore.docflow.Log4jDocFlowLogger.layout=org.apache.log4j.PatternLayout
log4j.appender.biz.redsoft.ncore.docflow.Log4jDocFlowLogger.layout.ConversionPattern=%d{dd.MM.yy HH:mm:ss.SSS},%t,%p,%c{1},%m%n
#log4j.appender.biz.redsoft.ncore.docflow.Log4jDocFlowLogger.encoding=UTF-8
log4j.appender.biz.redsoft.ncore.docflow.Log4jDocFlowLogger.File=logs/docflow.log
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{dd.MM.yy HH:mm:ss.SSS},%t,%p,%c{1},%m%n
#log4j.appender.stdout.encoding=UTF-8
log4j.appender.stdout.Threshold=DEBUG
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{dd.MM.yy HH:mm:ss.SSS},%t,%p,%c{1},%m%n
log4j.appender.file.encoding=UTF-8
log4j.appender.file.Threshold=INFO
log4j.appender.file.File=logs/stat.log
log4j.appender.file.Append=true

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<entry key="ncore.developer.mode">true</entry>
</properties>

16
ncore-properties.xml Normal file
View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>Configuration settings for ncore platform</comment>
<!-- Product settings -->
<entry key="product.name">sample</entry>
<entry key="product.title">Sample ncore project</entry>
<!-- Database settings -->
<entry key="jdbc.drivers">org.firebirdsql.jdbc.FBDriver</entry>
<entry key="ncore.db.url">jdbc:firebirdsql:localhost:ncore-sample-dev?lc_ctype=WIN1251</entry>
<entry key="ncore.db.user">SYSDBA</entry>
<entry key="ncore.db.password">masterkey</entry>
</properties>

1
settings.gradle Normal file
View File

@ -0,0 +1 @@
rootProject.name = 'sample'

3
src/dist/bin/start-client vendored Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
$(dirname $0)/starter client

3
src/dist/bin/start-client.bat vendored Executable file
View File

@ -0,0 +1,3 @@
@echo off
"%~dp0\..\starter.bat" client

5
src/dist/bin/starter vendored Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
cd $(dirname $0)/..
bin/sample $1 -config config/ncore-properties.xml -logconfig config/log4j.properties $2 $3 $4 $5
cd $OLDPWD

5
src/dist/bin/starter.bat vendored Executable file
View File

@ -0,0 +1,5 @@
@echo off
pushd "%~dp0\.."
bin\sample.bat %1 -config config\ncore-properties.xml -logconfig config\log4j.properties %2 %3 %4 %5
popd

24
src/dist/config/log4j.properties vendored Normal file
View File

@ -0,0 +1,24 @@
log4j.rootLogger=ERROR, file, stdout
log4j.logger.biz.redsoft.ncore.docflow.Log4jDocFlowLogger=ERROR, biz.redsoft.ncore.docflow.Log4jDocFlowLogger
log4j.appender.biz.redsoft.ncore.docflow.Log4jDocFlowLogger=org.apache.log4j.FileAppender
log4j.appender.biz.redsoft.ncore.docflow.Log4jDocFlowLogger.layout=org.apache.log4j.PatternLayout
log4j.appender.biz.redsoft.ncore.docflow.Log4jDocFlowLogger.layout.ConversionPattern=%d{dd.MM.yy HH:mm:ss.SSS},%t,%p,%c{1},%m%n
log4j.appender.biz.redsoft.ncore.docflow.Log4jDocFlowLogger.encoding=UTF-8
log4j.appender.biz.redsoft.ncore.docflow.Log4jDocFlowLogger.File=${server.home}/logs/sample-docflow.log
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{dd.MM.yy HH:mm:ss.SSS},%t,%p,%c{1},%m%n
log4j.appender.stdout.encoding=UTF-8
log4j.appender.stdout.Threshold=ERROR
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{dd.MM.yy HH:mm:ss.SSS},%t,%p,%c{1},%m%n
log4j.appender.file.encoding=UTF-8
log4j.appender.file.Threshold=ERROR
log4j.appender.file.File=${server.home}/logs/ncore-sample.log
log4j.appender.file.Append=true

16
src/dist/config/ncore-properties.xml vendored Normal file
View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>Configuration settings for ncore platform</comment>
<!-- Product settings -->
<entry key="product.name">sample</entry>
<entry key="product.title">Sample ncore project</entry>
<!-- Database settings -->
<entry key="jdbc.drivers">org.firebirdsql.jdbc.FBDriver</entry>
<entry key="ncore.db.url">jdbc:firebirdsql:localhost:ncore-sample?lc_ctype=WIN1251</entry>
<entry key="ncore.db.user">SYSDBA</entry>
<entry key="ncore.db.password">masterkey</entry>
</properties>

View File

@ -0,0 +1,26 @@
package biz.redsoft.sample;
import biz.redsoft.ncore.system.application.Application;
import java.util.Map;
/**
* @author Victor Bellavin
*/
public class Product implements biz.redsoft.ncore.product.Product {
@Override
public void init(Map<Object, Object> properties) {
}
@Override
public void init(Application application) {
}
@Override
public void destroy(Application application) {
}
@Override
public void destroy() {
}
}

View File

@ -0,0 +1,68 @@
package biz.redsoft.sample;
import biz.redsoft.util.IncorrectVersionFormat;
import biz.redsoft.util.VersionUtils;
import org.apache.log4j.Logger;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
/**
* @author Victor Bellavin
*/
public class Version {
public static final Logger LOGGER = Logger.getLogger(Version.class);
public static final String VERSION_FILE = "version.properties";
public static final String VERSION_PROP_NAME = "version";
private static final VersionUtils.Version version = readVersion();
public static VersionUtils.Version getInstance() {
return getVersion();
}
public static VersionUtils.Version getVersion() {
return version;
}
private static VersionUtils.Version readVersion() {
final VersionUtils.Version version = new VersionUtils.Version();
final String packageName = Version.class.getPackage().getName();
final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
final String versionPath = "META-INF/ncore-product/" + packageName + "/" + VERSION_FILE;
final InputStream is = classLoader.getResourceAsStream(versionPath);
if (is != null) {
loadVersion(version, is);
} else {
LOGGER.warn("No version resource at " + versionPath + " Trying to load it from the main package...");
final InputStream oldStream = Version.class.getResourceAsStream(VERSION_FILE);
if (oldStream != null)
loadVersion(version, oldStream);
else
LOGGER.error("No version resource in classpath");
}
return version;
}
private static void loadVersion(VersionUtils.Version version, InputStream is) {
try {
try {
final Properties props = new Properties();
props.load(is);
final String moduleVersion = props.getProperty(VERSION_PROP_NAME);
if (moduleVersion != null)
version.setVersion(moduleVersion);
else
LOGGER.error("No module.version key in version properties");
} catch (IncorrectVersionFormat e) {
LOGGER.error("Error reading version", e);
} finally {
is.close();
}
}catch (IOException e) {
LOGGER.error("Error reading version", e);
}
}
}

View File

@ -0,0 +1,4 @@
{
"dependencies": [],
"register": {}
}

View File

@ -0,0 +1,3 @@
version=1.1.1.1-SNAPSHOT
# release | build | patchset
type=release

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<Context>
<Manager pathname="" />
</Context>

View File

@ -0,0 +1,24 @@
log4j.rootLogger=ERROR, file, stdout
log4j.logger.biz.redsoft.ncore.docflow.Log4jDocFlowLogger=ERROR, biz.redsoft.ncore.docflow.Log4jDocFlowLogger
log4j.appender.biz.redsoft.ncore.docflow.Log4jDocFlowLogger=org.apache.log4j.FileAppender
log4j.appender.biz.redsoft.ncore.docflow.Log4jDocFlowLogger.layout=org.apache.log4j.PatternLayout
log4j.appender.biz.redsoft.ncore.docflow.Log4jDocFlowLogger.layout.ConversionPattern=%d{dd.MM.yy HH:mm:ss.SSS},%t,%p,%c{1},%m%n
log4j.appender.biz.redsoft.ncore.docflow.Log4jDocFlowLogger.encoding=UTF-8
log4j.appender.biz.redsoft.ncore.docflow.Log4jDocFlowLogger.File=${server.home}/logs/sample-docflow.log
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{dd.MM.yy HH:mm:ss.SSS},%t,%p,%c{1},%m%n
log4j.appender.stdout.encoding=UTF-8
log4j.appender.stdout.Threshold=ERROR
log4j.appender.file=org.apache.log4j.FileAppender
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{dd.MM.yy HH:mm:ss.SSS},%t,%p,%c{1},%m%n
log4j.appender.file.encoding=UTF-8
log4j.appender.file.Threshold=ERROR
log4j.appender.file.File=${server.home}/logs/ncore-sample.log
log4j.appender.file.Append=true

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>Configuration settings for ncore platform</comment>
<!-- Product settings -->
<entry key="product.name">sample</entry>
<entry key="product.title">Sample ncore project</entry>
<!-- Database settings -->
<entry key="jdbc.drivers">org.firebirdsql.jdbc.FBDriver</entry>
<entry key="ncore.db.url">jdbc:firebirdsql:localhost:ncore-sample?lc_ctype=WIN1251</entry>
<entry key="ncore.db.user">SYSDBA</entry>
<entry key="ncore.db.password">masterkey</entry>
</properties>

View File

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<display-name>Sample server</display-name>
<context-param>
<param-name>productionMode</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<description>A list of ncore config files</description>
<param-name>ncoreConfigFiles</param-name>
<param-value>
ncore-properties.xml
ncore-properties-local.xml
</param-value>
</context-param>
<servlet>
<servlet-name>ncore</servlet-name>
<servlet-class>biz.redsoft.ncore.server.NcoreApplicationServlet</servlet-class>
<init-param>
<description>Vaadin application class to start</description>
<param-name>application</param-name>
<param-value>biz.redsoft.ncore.client.vaadin.WebApplication</param-value>
</init-param>
<init-param>
<description>Application widgetset</description>
<param-name>widgetset</param-name>
<param-value>biz.redsoft.ncore.client.vaadin.NcoreWidgetset</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>ncore</servlet-name>
<url-pattern>/client/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ncore</servlet-name>
<url-pattern>/VAADIN/*</url-pattern>
</servlet-mapping>
<listener>
<listener-class>biz.redsoft.ncore.dx.init.DxInitializationListener</listener-class>
</listener>
<welcome-file-list>
<welcome-file>client</welcome-file>
</welcome-file-list>
</web-app>

View File

@ -0,0 +1,22 @@
package biz.redsoft.sample;
import biz.redsoft.ncore.util.Misc;
import java.io.IOException;
import java.util.Arrays;
import java.util.Properties;
import org.junit.Assert;
import org.junit.Test;
/**
* @author Victor Bellavin
*/
public class SampleTests {
@Test
public void testProductName() throws IOException {
final Properties props = new Properties(System.getProperties());
Misc.loadProperties(props, Arrays.asList("ncore-properties.xml", "ncore-properties-local.xml"));
Assert.assertEquals(props.getProperty("product.name"), "sample");
}
}

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="windows-1251"?>
<Objects
xsi:schemaLocation="http://www.red-soft.biz/2009/ncore xsd/ncore.xsd" xmlns="http://www.red-soft.biz/2009/ncore" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SysPatch
CreateDate="2015-03-01T21:15:50.513"
Description="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> sample."
Documentclassid="8001"
DocDate="2015-03-01"
DocNumber="SAMPLE-0000001"
Metaobjectname="SYS_PATCH"
SpControlNumber="644"
SpControlProject="tracker"
SpNumber="1"
SpRevision="1"
SpSqlAfter=""
SpSqlBefore=""
SpStatus="2"
SpSubsystem="SAMPLE"
SpSyncSql=""
SpTimestamp="2015-03-01T21:15:50.513"
SpUser="<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
TagList="">
<DetSysLogSysPatch/>
</SysPatch>
</Objects>