commit
414845b6d0
@ -0,0 +1,25 @@
|
||||
/target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/build/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
@ -0,0 +1,42 @@
|
||||
[INFO] Scanning for projects...
|
||||
[WARNING]
|
||||
[WARNING] Some problems were encountered while building the effective model for com.pjb:springboot-jjwt:jar:0.0.1-SNAPSHOT
|
||||
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.projectlombok:lombok:jar -> version (?) vs 1.16.22 @ line 271, column 21
|
||||
[WARNING]
|
||||
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
|
||||
[WARNING]
|
||||
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
|
||||
[WARNING]
|
||||
[INFO]
|
||||
[INFO] ----------------------< com.pjb:springboot-jjwt >-----------------------
|
||||
[INFO] Building springboot-jjwt 0.0.1-SNAPSHOT
|
||||
[INFO] --------------------------------[ jar ]---------------------------------
|
||||
[INFO]
|
||||
[INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ springboot-jjwt ---
|
||||
[INFO] Using 'UTF-8' encoding to copy filtered resources.
|
||||
[INFO] Copying 5 resources
|
||||
[INFO] Copying 9 resources
|
||||
[INFO]
|
||||
[INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ springboot-jjwt ---
|
||||
[INFO] Nothing to compile - all classes are up to date
|
||||
[INFO]
|
||||
[INFO] --- maven-resources-plugin:3.0.1:testResources (default-testResources) @ springboot-jjwt ---
|
||||
[INFO] Using 'UTF-8' encoding to copy filtered resources.
|
||||
[INFO] skip non existing resourceDirectory D:\file store\JavaWorkSpace\IDEA\java_git\src\test\resources
|
||||
[INFO]
|
||||
[INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ springboot-jjwt ---
|
||||
[INFO] Nothing to compile - all classes are up to date
|
||||
[INFO]
|
||||
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) @ springboot-jjwt ---
|
||||
[INFO] Tests are skipped.
|
||||
[INFO]
|
||||
[INFO] --- maven-jar-plugin:2.6:jar (default-jar) @ springboot-jjwt ---
|
||||
[INFO] Building jar: D:\file store\JavaWorkSpace\IDEA\java_git\target\HG Standard Interface And PM Interface Services v0.1.jar
|
||||
[INFO]
|
||||
[INFO] --- spring-boot-maven-plugin:2.0.3.RELEASE:repackage (default) @ springboot-jjwt ---
|
||||
[INFO] ------------------------------------------------------------------------
|
||||
[INFO] BUILD SUCCESS
|
||||
[INFO] ------------------------------------------------------------------------
|
||||
[INFO] Total time: 4.259 s
|
||||
[INFO] Finished at: 2022-09-22T16:41:21+08:00
|
||||
[INFO] ------------------------------------------------------------------------
|
@ -0,0 +1,224 @@
|
||||
#
|
||||
# There is insufficient memory for the Java Runtime Environment to continue.
|
||||
# Native memory allocation (malloc) failed to allocate 701936 bytes for Chunk::new
|
||||
# Possible reasons:
|
||||
# The system is out of physical RAM or swap space
|
||||
# In 32 bit mode, the process size limit was hit
|
||||
# Possible solutions:
|
||||
# Reduce memory load on the system
|
||||
# Increase physical memory or swap space
|
||||
# Check if swap backing store is full
|
||||
# Use 64 bit Java on a 64 bit OS
|
||||
# Decrease Java heap size (-Xmx/-Xms)
|
||||
# Decrease number of Java threads
|
||||
# Decrease Java thread stack sizes (-Xss)
|
||||
# Set larger code cache with -XX:ReservedCodeCacheSize=
|
||||
# This output file may be truncated or incomplete.
|
||||
#
|
||||
# Out of Memory Error (allocation.cpp:390), pid=16260, tid=0x0000000000004ed4
|
||||
#
|
||||
# JRE version: Java(TM) SE Runtime Environment (8.0_181-b13) (build 1.8.0_181-b13)
|
||||
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.181-b13 mixed mode windows-amd64 compressed oops)
|
||||
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
|
||||
#
|
||||
|
||||
--------------- T H R E A D ---------------
|
||||
|
||||
Current thread (0x000000001e275000): JavaThread "C2 CompilerThread2" daemon [_thread_in_native, id=20180, stack(0x000000001eb40000,0x000000001ec40000)]
|
||||
|
||||
Stack: [0x000000001eb40000,0x000000001ec40000]
|
||||
[error occurred during error reporting (printing stack bounds), id 0xc0000005]
|
||||
|
||||
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
|
||||
|
||||
|
||||
Current CompileTask:
|
||||
C2: 828 1490 ! 4 java.net.URL::<init> (543 bytes)
|
||||
|
||||
|
||||
--------------- P R O C E S S ---------------
|
||||
|
||||
Java Threads: ( => current thread )
|
||||
0x000000001e30b000 JavaThread "Service Thread" daemon [_thread_blocked, id=15988, stack(0x000000001ed40000,0x000000001ee40000)]
|
||||
0x000000001e27d000 JavaThread "C1 CompilerThread3" daemon [_thread_blocked, id=13232, stack(0x000000001ec40000,0x000000001ed40000)]
|
||||
=>0x000000001e275000 JavaThread "C2 CompilerThread2" daemon [_thread_in_native, id=20180, stack(0x000000001eb40000,0x000000001ec40000)]
|
||||
0x000000001e274800 JavaThread "C2 CompilerThread1" daemon [_thread_in_native, id=13348, stack(0x000000001ea40000,0x000000001eb40000)]
|
||||
0x000000001e271800 JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=8016, stack(0x000000001e940000,0x000000001ea40000)]
|
||||
0x000000001e21a000 JavaThread "Attach Listener" daemon [_thread_blocked, id=6148, stack(0x000000001e840000,0x000000001e940000)]
|
||||
0x000000001e219000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=14388, stack(0x000000001e740000,0x000000001e840000)]
|
||||
0x000000001e200800 JavaThread "Finalizer" daemon [_thread_blocked, id=9328, stack(0x000000001e5e0000,0x000000001e6e0000)]
|
||||
0x000000001c30d800 JavaThread "Reference Handler" daemon [_thread_blocked, id=9668, stack(0x000000001e0e0000,0x000000001e1e0000)]
|
||||
0x00000000028c2800 JavaThread "main" [_thread_in_vm, id=20224, stack(0x0000000002710000,0x0000000002810000)]
|
||||
|
||||
Other Threads:
|
||||
0x000000001c307800 VMThread [stack: 0x000000001dfe0000,0x000000001e0e0000] [id=19244]
|
||||
0x000000001e325800 WatcherThread [stack: 0x000000001ee40000,0x000000001ef40000] [id=18728]
|
||||
|
||||
VM state:not at safepoint (normal execution)
|
||||
|
||||
VM Mutex/Monitor currently owned by a thread: None
|
||||
|
||||
Heap:
|
||||
PSYoungGen total 75776K, used 39444K [0x000000076bb80000, 0x0000000771000000, 0x00000007c0000000)
|
||||
eden space 65024K, 44% used [0x000000076bb80000,0x000000076d8083f8,0x000000076fb00000)
|
||||
from space 10752K, 95% used [0x000000076fb00000,0x00000007704fce10,0x0000000770580000)
|
||||
to space 10752K, 0% used [0x0000000770580000,0x0000000770580000,0x0000000771000000)
|
||||
ParOldGen total 173568K, used 16K [0x00000006c3200000, 0x00000006cdb80000, 0x000000076bb80000)
|
||||
object space 173568K, 0% used [0x00000006c3200000,0x00000006c3204000,0x00000006cdb80000)
|
||||
Metaspace used 14563K, capacity 14748K, committed 14976K, reserved 1062912K
|
||||
class space used 1796K, capacity 1876K, committed 1920K, reserved 1048576K
|
||||
|
||||
Card table byte_map: [0x0000000011d80000,0x0000000012570000] byte_map_base: 0x000000000e767000
|
||||
|
||||
Marking Bits: (ParMarkBitMap*) 0x0000000065de2d00
|
||||
Begin Bits: [0x00000000132c0000, 0x00000000171f8000)
|
||||
End Bits: [0x00000000171f8000, 0x000000001b130000)
|
||||
|
||||
Polling page: 0x0000000002330000
|
||||
|
||||
CodeCache: size=245760Kb used=5620Kb max_used=5626Kb free=240139Kb
|
||||
bounds [0x00000000029c0000, 0x0000000002f50000, 0x00000000119c0000]
|
||||
total_blobs=1933 nmethods=1587 adapters=257
|
||||
compilation: enabled
|
||||
|
||||
Compilation events (10 events):
|
||||
Event: 0.825 Thread 0x000000001e27d000 1580 3 java.lang.reflect.Method::equals (69 bytes)
|
||||
Event: 0.825 Thread 0x000000001e27d000 nmethod 1580 0x0000000002f3af10 code [0x0000000002f3b0a0, 0x0000000002f3ba28]
|
||||
Event: 0.825 Thread 0x000000001e27d000 1582 3 java.lang.Class$MethodArray::removeByNameAndDescriptor (42 bytes)
|
||||
Event: 0.825 Thread 0x000000001e27d000 nmethod 1582 0x0000000002f3bb50 code [0x0000000002f3bce0, 0x0000000002f3c018]
|
||||
Event: 0.825 Thread 0x000000001e27d000 1583 3 java.lang.Class$MethodArray::addIfNotPresent (47 bytes)
|
||||
Event: 0.825 Thread 0x000000001e27d000 nmethod 1583 0x0000000002f3c190 code [0x0000000002f3c320, 0x0000000002f3c718]
|
||||
Event: 0.825 Thread 0x000000001e27d000 1581 3 java.lang.Class$MethodArray::get (7 bytes)
|
||||
Event: 0.825 Thread 0x000000001e27d000 nmethod 1581 0x0000000002f3c8d0 code [0x0000000002f3ca20, 0x0000000002f3cbb0]
|
||||
Event: 0.825 Thread 0x000000001e27d000 1584 3 java.lang.Math::min (46 bytes)
|
||||
Event: 0.826 Thread 0x000000001e27d000 nmethod 1584 0x0000000002f3cc90 code [0x0000000002f3ce00, 0x0000000002f3d150]
|
||||
|
||||
GC Heap History (2 events):
|
||||
Event: 0.560 GC heap before
|
||||
{Heap before GC invocations=1 (full 0):
|
||||
PSYoungGen total 75776K, used 65024K [0x000000076bb80000, 0x0000000771000000, 0x00000007c0000000)
|
||||
eden space 65024K, 100% used [0x000000076bb80000,0x000000076fb00000,0x000000076fb00000)
|
||||
from space 10752K, 0% used [0x0000000770580000,0x0000000770580000,0x0000000771000000)
|
||||
to space 10752K, 0% used [0x000000076fb00000,0x000000076fb00000,0x0000000770580000)
|
||||
ParOldGen total 173568K, used 0K [0x00000006c3200000, 0x00000006cdb80000, 0x000000076bb80000)
|
||||
object space 173568K, 0% used [0x00000006c3200000,0x00000006c3200000,0x00000006cdb80000)
|
||||
Metaspace used 11068K, capacity 11204K, committed 11520K, reserved 1058816K
|
||||
class space used 1350K, capacity 1412K, committed 1536K, reserved 1048576K
|
||||
Event: 0.566 GC heap after
|
||||
Heap after GC invocations=1 (full 0):
|
||||
PSYoungGen total 75776K, used 10227K [0x000000076bb80000, 0x0000000771000000, 0x00000007c0000000)
|
||||
eden space 65024K, 0% used [0x000000076bb80000,0x000000076bb80000,0x000000076fb00000)
|
||||
from space 10752K, 95% used [0x000000076fb00000,0x00000007704fce10,0x0000000770580000)
|
||||
to space 10752K, 0% used [0x0000000770580000,0x0000000770580000,0x0000000771000000)
|
||||
ParOldGen total 173568K, used 16K [0x00000006c3200000, 0x00000006cdb80000, 0x000000076bb80000)
|
||||
object space 173568K, 0% used [0x00000006c3200000,0x00000006c3204000,0x00000006cdb80000)
|
||||
Metaspace used 11068K, capacity 11204K, committed 11520K, reserved 1058816K
|
||||
class space used 1350K, capacity 1412K, committed 1536K, reserved 1048576K
|
||||
}
|
||||
|
||||
Deoptimization events (10 events):
|
||||
Event: 0.738 Thread 0x00000000028c2800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002cba808 method=org.codehaus.plexus.util.xml.pull.MXParser.nextImpl()I @ 1046
|
||||
Event: 0.772 Thread 0x00000000028c2800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002af4d00 method=java.lang.CharacterData.of(I)Ljava/lang/CharacterData; @ 4
|
||||
Event: 0.782 Thread 0x00000000028c2800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002c2c3ac method=java.lang.AbstractStringBuilder.append(Ljava/lang/String;)Ljava/lang/AbstractStringBuilder; @ 1
|
||||
Event: 0.782 Thread 0x00000000028c2800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002baf490 method=java.lang.AbstractStringBuilder.append(Ljava/lang/String;)Ljava/lang/AbstractStringBuilder; @ 1
|
||||
Event: 0.787 Thread 0x00000000028c2800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002ba9398 method=sun.misc.MetaIndex.mayContain(Ljava/lang/String;)Z @ 38
|
||||
Event: 0.790 Thread 0x00000000028c2800 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x0000000002f093e4 method=java.util.regex.Pattern$CharProperty.match(Ljava/util/regex/Matcher;ILjava/lang/CharSequence;)Z @ 37
|
||||
Event: 0.790 Thread 0x00000000028c2800 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x0000000002f093e4 method=java.util.regex.Pattern$CharProperty.match(Ljava/util/regex/Matcher;ILjava/lang/CharSequence;)Z @ 37
|
||||
Event: 0.798 Thread 0x00000000028c2800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002b5e440 method=java.lang.String.replace(CC)Ljava/lang/String; @ 2
|
||||
Event: 0.798 Thread 0x00000000028c2800 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x0000000002f093e4 method=java.util.regex.Pattern$CharProperty.match(Ljava/util/regex/Matcher;ILjava/lang/CharSequence;)Z @ 37
|
||||
Event: 0.798 Thread 0x00000000028c2800 Uncommon trap: reason=bimorphic action=maybe_recompile pc=0x0000000002f093e4 method=java.util.regex.Pattern$CharProperty.match(Ljava/util/regex/Matcher;ILjava/lang/CharSequence;)Z @ 37
|
||||
|
||||
Classes redefined (0 events):
|
||||
No events
|
||||
|
||||
Internal exceptions (10 events):
|
||||
Event: 0.687 Thread 0x00000000028c2800 Exception <a 'java/lang/NoClassDefFoundError'> (0x000000076cab00e8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\prims\jvm.cpp, line 1439]
|
||||
Event: 0.687 Thread 0x00000000028c2800 Exception <a 'java/lang/NoClassDefFoundError': javax/annotation/Priority> (0x000000076cab5140) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\classfile\systemDictionary.cpp, line 199]
|
||||
Event: 0.762 Thread 0x00000000028c2800 Exception <a 'java/lang/NullPointerException'> (0x000000076d0ce458) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\interpreter\linkResolver.cpp, line 1185]
|
||||
Event: 0.762 Thread 0x00000000028c2800 Exception <a 'java/lang/NullPointerException'> (0x000000076d0ce660) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\interpreter\linkResolver.cpp, line 1185]
|
||||
Event: 0.762 Thread 0x00000000028c2800 Exception <a 'java/lang/NullPointerException'> (0x000000076d0ce868) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\interpreter\linkResolver.cpp, line 1185]
|
||||
Event: 0.762 Thread 0x00000000028c2800 Exception <a 'java/lang/NullPointerException'> (0x000000076d0d6dc0) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\interpreter\linkResolver.cpp, line 1185]
|
||||
Event: 0.762 Thread 0x00000000028c2800 Exception <a 'java/lang/NullPointerException'> (0x000000076d0d6fc8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\interpreter\linkResolver.cpp, line 1185]
|
||||
Event: 0.762 Thread 0x00000000028c2800 Exception <a 'java/lang/NullPointerException'> (0x000000076d0d71d0) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\interpreter\linkResolver.cpp, line 1185]
|
||||
Event: 0.782 Thread 0x00000000028c2800 Implicit null exception at 0x0000000002c2bfd9 to 0x0000000002c2c395
|
||||
Event: 0.782 Thread 0x00000000028c2800 Implicit null exception at 0x0000000002baf0d6 to 0x0000000002baf479
|
||||
|
||||
Events (10 events):
|
||||
Event: 0.824 loading class org/apache/maven/model/MailingList
|
||||
Event: 0.824 loading class org/apache/maven/model/MailingList done
|
||||
Event: 0.824 loading class org/apache/maven/model/CiManagement
|
||||
Event: 0.824 loading class org/apache/maven/model/CiManagement done
|
||||
Event: 0.824 loading class org/apache/maven/model/Organization
|
||||
Event: 0.824 loading class org/apache/maven/model/Organization done
|
||||
Event: 0.824 loading class org/apache/maven/model/DistributionManagement
|
||||
Event: 0.824 loading class org/apache/maven/model/DistributionManagement done
|
||||
Event: 0.826 loading class org/codehaus/plexus/interpolation/util/StringUtils
|
||||
Event: 0.826 loading class org/codehaus/plexus/interpolation/util/StringUtils done
|
||||
|
||||
|
||||
Dynamic libraries:
|
||||
0x00007ff6bafb0000 - 0x00007ff6bafe7000 C:\Java\jdk1.8.0_181\bin\java.exe
|
||||
0x00007fffa59d0000 - 0x00007fffa5bc8000 C:\WINDOWS\SYSTEM32\ntdll.dll
|
||||
0x00007fffa4630000 - 0x00007fffa46ef000 C:\WINDOWS\System32\KERNEL32.DLL
|
||||
0x00007fffa36d0000 - 0x00007fffa39a2000 C:\WINDOWS\System32\KERNELBASE.dll
|
||||
0x00007fffa5590000 - 0x00007fffa563e000 C:\WINDOWS\System32\ADVAPI32.dll
|
||||
0x00007fffa4570000 - 0x00007fffa460e000 C:\WINDOWS\System32\msvcrt.dll
|
||||
0x00007fffa54f0000 - 0x00007fffa558c000 C:\WINDOWS\System32\sechost.dll
|
||||
0x00007fffa43e0000 - 0x00007fffa4505000 C:\WINDOWS\System32\RPCRT4.dll
|
||||
0x00007fffa3a20000 - 0x00007fffa3bbd000 C:\WINDOWS\System32\USER32.dll
|
||||
0x00007fffa33d0000 - 0x00007fffa33f2000 C:\WINDOWS\System32\win32u.dll
|
||||
0x00007fffa4ea0000 - 0x00007fffa4ecb000 C:\WINDOWS\System32\GDI32.dll
|
||||
0x00007fffa34e0000 - 0x00007fffa35ef000 C:\WINDOWS\System32\gdi32full.dll
|
||||
0x00007fffa31d0000 - 0x00007fffa326d000 C:\WINDOWS\System32\msvcp_win.dll
|
||||
0x00007fffa30d0000 - 0x00007fffa31d0000 C:\WINDOWS\System32\ucrtbase.dll
|
||||
0x00007fff7b1b0000 - 0x00007fff7b44a000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e\COMCTL32.dll
|
||||
0x00007fffa4d40000 - 0x00007fffa4d72000 C:\WINDOWS\System32\IMM32.DLL
|
||||
0x0000000065e70000 - 0x0000000065f42000 C:\Java\jdk1.8.0_181\jre\bin\msvcr100.dll
|
||||
0x00000000655c0000 - 0x0000000065e62000 C:\Java\jdk1.8.0_181\jre\bin\server\jvm.dll
|
||||
0x00007fffa48c0000 - 0x00007fffa48c8000 C:\WINDOWS\System32\PSAPI.DLL
|
||||
0x00007fff825d0000 - 0x00007fff825d9000 C:\WINDOWS\SYSTEM32\WSOCK32.dll
|
||||
0x00007fff7d0f0000 - 0x00007fff7d117000 C:\WINDOWS\SYSTEM32\WINMM.dll
|
||||
0x00007fff94080000 - 0x00007fff9408a000 C:\WINDOWS\SYSTEM32\VERSION.dll
|
||||
0x00007fffa5640000 - 0x00007fffa56ab000 C:\WINDOWS\System32\WS2_32.dll
|
||||
0x00000000655b0000 - 0x00000000655bf000 C:\Java\jdk1.8.0_181\jre\bin\verify.dll
|
||||
0x0000000065580000 - 0x00000000655a9000 C:\Java\jdk1.8.0_181\jre\bin\java.dll
|
||||
0x0000000065560000 - 0x0000000065576000 C:\Java\jdk1.8.0_181\jre\bin\zip.dll
|
||||
0x00007fffa3bc0000 - 0x00007fffa4303000 C:\WINDOWS\System32\SHELL32.dll
|
||||
0x00007fffa0c80000 - 0x00007fffa1412000 C:\WINDOWS\SYSTEM32\windows.storage.dll
|
||||
0x00007fffa4930000 - 0x00007fffa4c84000 C:\WINDOWS\System32\combase.dll
|
||||
0x00007fffa2b30000 - 0x00007fffa2b60000 C:\WINDOWS\SYSTEM32\Wldp.dll
|
||||
0x00007fffa4c90000 - 0x00007fffa4d3d000 C:\WINDOWS\System32\SHCORE.dll
|
||||
0x00007fffa4310000 - 0x00007fffa4365000 C:\WINDOWS\System32\shlwapi.dll
|
||||
0x00007fffa3010000 - 0x00007fffa302f000 C:\WINDOWS\SYSTEM32\profapi.dll
|
||||
0x00007fff893f0000 - 0x00007fff893fa000 D:\Installation directory\apache-maven-3.8.1\lib\jansi-native\windows64\jansi.dll
|
||||
|
||||
VM Arguments:
|
||||
jvm_args: -Dclassworlds.conf=D:\Installation directory\apache-maven-3.8.1\bin\..\bin\m2.conf -Dmaven.home=D:\Installation directory\apache-maven-3.8.1\bin\.. -Dlibrary.jansi.path=D:\Installation directory\apache-maven-3.8.1\bin\..\lib\jansi-native -Dmaven.multiModuleProjectDirectory=D:\file store\ÏîÄ¿´úÂë\Àϰå¶þÆÚ\java_git
|
||||
java_command: org.codehaus.plexus.classworlds.launcher.Launcher package -DskipTests
|
||||
java_class_path (initial): D:\Installation directory\apache-maven-3.8.1\bin\..\boot\plexus-classworlds-2.6.0.jar
|
||||
Launcher Type: SUN_STANDARD
|
||||
|
||||
Environment Variables:
|
||||
JAVA_HOME=C:\Java\jdk1.8.0_181
|
||||
JRE_HOME=C:\Java\jdk1.8.0_181\jre
|
||||
CLASSPATH=.;C:\Java\jdk1.8.0_181\lib\dt.jar;C:\Java\jdk1.8.0_181\lib\tools.jar;
|
||||
PATH=C:\Program Files\AdoptOpenJDK\jdk-8.0.282.8-hotspot\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;D:\Installation directory\VMware\bin\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\ZeroTier\One\;%FMS_HOME%\lib;C:\Program Files\dotnet\;C:\WINDOWS\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;D:\Tomcat8.5\apache-tomcat-8.5.73;C:\Java\jdk1.8.0_181\bin;C:\Java\jdk1.8.0_181\jre\bin;D:\Installation directory\apache-maven-3.8.1\bin;C:\Program Files\Git\cmd;C:\Users\upaad\AppData\Local\Microsoft\WindowsApps;D:\Installation directory\VSCode\Microsoft VS Code\bin;C:\Users\upaad\.dotnet\tools;C:\Users\upaad\AppData\Local\JetBrains\Toolbox\scripts;
|
||||
USERNAME=upaad
|
||||
OS=Windows_NT
|
||||
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 140 Stepping 1, GenuineIntel
|
||||
|
||||
|
||||
|
||||
--------------- S Y S T E M ---------------
|
||||
|
||||
OS: Windows 10.0 , 64 bit Build 19041 (10.0.19041.2251)
|
||||
|
||||
CPU:total 8 (initial active 8) (4 cores per cpu, 2 threads per core) family 6 model 140 stepping 1, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, 3dnowpref, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2, adx
|
||||
|
||||
Memory: 4k page, physical 16571704k(833464k free), swap 22029804k(5528k free)
|
||||
|
||||
vm_info: Java HotSpot(TM) 64-Bit Server VM (25.181-b13) for windows-amd64 JRE (1.8.0_181-b13), built on Jul 7 2018 04:01:33 by "java_re" with MS VC++ 10.0 (VS2010)
|
||||
|
||||
time: Tue Nov 22 11:01:26 2022
|
||||
elapsed time: 0 seconds (0d 0h 0m 0s)
|
||||
|
@ -0,0 +1,202 @@
|
||||
#
|
||||
# There is insufficient memory for the Java Runtime Environment to continue.
|
||||
# Native memory allocation (malloc) failed to allocate 467856 bytes for Chunk::new
|
||||
# Possible reasons:
|
||||
# The system is out of physical RAM or swap space
|
||||
# In 32 bit mode, the process size limit was hit
|
||||
# Possible solutions:
|
||||
# Reduce memory load on the system
|
||||
# Increase physical memory or swap space
|
||||
# Check if swap backing store is full
|
||||
# Use 64 bit Java on a 64 bit OS
|
||||
# Decrease Java heap size (-Xmx/-Xms)
|
||||
# Decrease number of Java threads
|
||||
# Decrease Java thread stack sizes (-Xss)
|
||||
# Set larger code cache with -XX:ReservedCodeCacheSize=
|
||||
# This output file may be truncated or incomplete.
|
||||
#
|
||||
# Out of Memory Error (allocation.cpp:390), pid=20456, tid=0x00000000000046f8
|
||||
#
|
||||
# JRE version: Java(TM) SE Runtime Environment (8.0_181-b13) (build 1.8.0_181-b13)
|
||||
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.181-b13 mixed mode windows-amd64 compressed oops)
|
||||
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
|
||||
#
|
||||
|
||||
--------------- T H R E A D ---------------
|
||||
|
||||
Current thread (0x000000001e29d800): JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=18168, stack(0x000000001e910000,0x000000001ea10000)]
|
||||
|
||||
Stack: [0x000000001e910000,0x000000001ea10000]
|
||||
[error occurred during error reporting (printing stack bounds), id 0xc0000005]
|
||||
|
||||
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
|
||||
|
||||
|
||||
Current CompileTask:
|
||||
C2: 428 750 % 4 java.io.WinNTFileSystem::normalize @ 22 (143 bytes)
|
||||
|
||||
|
||||
--------------- P R O C E S S ---------------
|
||||
|
||||
Java Threads: ( => current thread )
|
||||
0x000000001e33b000 JavaThread "Service Thread" daemon [_thread_blocked, id=10892, stack(0x000000001ed10000,0x000000001ee10000)]
|
||||
0x000000001e2ad800 JavaThread "C1 CompilerThread3" daemon [_thread_blocked, id=16652, stack(0x000000001ec10000,0x000000001ed10000)]
|
||||
0x000000001e2a6000 JavaThread "C2 CompilerThread2" daemon [_thread_in_native, id=6528, stack(0x000000001eb10000,0x000000001ec10000)]
|
||||
0x000000001e2a4800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=6592, stack(0x000000001ea10000,0x000000001eb10000)]
|
||||
=>0x000000001e29d800 JavaThread "C2 CompilerThread0" daemon [_thread_in_native, id=18168, stack(0x000000001e910000,0x000000001ea10000)]
|
||||
0x000000001e24a000 JavaThread "Attach Listener" daemon [_thread_blocked, id=19680, stack(0x000000001e810000,0x000000001e910000)]
|
||||
0x000000001e249000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=3796, stack(0x000000001e710000,0x000000001e810000)]
|
||||
0x000000001e230800 JavaThread "Finalizer" daemon [_thread_blocked, id=10212, stack(0x000000001e610000,0x000000001e710000)]
|
||||
0x0000000002939000 JavaThread "Reference Handler" daemon [_thread_blocked, id=1684, stack(0x000000001e110000,0x000000001e210000)]
|
||||
0x0000000002842800 JavaThread "main" [_thread_in_native, id=4252, stack(0x0000000002380000,0x0000000002480000)]
|
||||
|
||||
Other Threads:
|
||||
0x000000001c327800 VMThread [stack: 0x000000001e010000,0x000000001e110000] [id=3536]
|
||||
0x000000001e355800 WatcherThread [stack: 0x000000001ee10000,0x000000001ef10000] [id=18244]
|
||||
|
||||
VM state:not at safepoint (normal execution)
|
||||
|
||||
VM Mutex/Monitor currently owned by a thread: None
|
||||
|
||||
Heap:
|
||||
PSYoungGen total 75776K, used 43015K [0x000000076bb80000, 0x0000000771000000, 0x00000007c0000000)
|
||||
eden space 65024K, 66% used [0x000000076bb80000,0x000000076e581f18,0x000000076fb00000)
|
||||
from space 10752K, 0% used [0x0000000770580000,0x0000000770580000,0x0000000771000000)
|
||||
to space 10752K, 0% used [0x000000076fb00000,0x000000076fb00000,0x0000000770580000)
|
||||
ParOldGen total 173568K, used 0K [0x00000006c3200000, 0x00000006cdb80000, 0x000000076bb80000)
|
||||
object space 173568K, 0% used [0x00000006c3200000,0x00000006c3200000,0x00000006cdb80000)
|
||||
Metaspace used 8824K, capacity 8968K, committed 9088K, reserved 1056768K
|
||||
class space used 1065K, capacity 1114K, committed 1152K, reserved 1048576K
|
||||
|
||||
Card table byte_map: [0x0000000011da0000,0x0000000012590000] byte_map_base: 0x000000000e787000
|
||||
|
||||
Marking Bits: (ParMarkBitMap*) 0x0000000065de2d00
|
||||
Begin Bits: [0x00000000132e0000, 0x0000000017218000)
|
||||
End Bits: [0x0000000017218000, 0x000000001b150000)
|
||||
|
||||
Polling page: 0x0000000000660000
|
||||
|
||||
CodeCache: size=245760Kb used=3396Kb max_used=3404Kb free=242363Kb
|
||||
bounds [0x00000000029e0000, 0x0000000002d40000, 0x00000000119e0000]
|
||||
total_blobs=1091 nmethods=782 adapters=222
|
||||
compilation: enabled
|
||||
|
||||
Compilation events (10 events):
|
||||
Event: 0.421 Thread 0x000000001e2ad800 nmethod 768 0x0000000002d28cd0 code [0x0000000002d29080, 0x0000000002d2ae68]
|
||||
Event: 0.421 Thread 0x000000001e2ad800 770 3 java.nio.Buffer::nextGetIndex (38 bytes)
|
||||
Event: 0.421 Thread 0x000000001e2ad800 nmethod 770 0x0000000002d27c10 code [0x0000000002d27d80, 0x0000000002d27fa8]
|
||||
Event: 0.421 Thread 0x000000001e2ad800 769 3 java.lang.Class::getAnnotation (22 bytes)
|
||||
Event: 0.421 Thread 0x000000001e2ad800 nmethod 769 0x0000000002d27410 code [0x0000000002d275c0, 0x0000000002d27a68]
|
||||
Event: 0.421 Thread 0x000000001e2ad800 771 1 java.lang.reflect.Proxy$Key1::hashCode (5 bytes)
|
||||
Event: 0.421 Thread 0x000000001e2ad800 nmethod 771 0x0000000002d27150 code [0x0000000002d272a0, 0x0000000002d273b0]
|
||||
Event: 0.422 Thread 0x000000001e2ad800 772 3 java.nio.HeapByteBuffer::getShort (18 bytes)
|
||||
Event: 0.422 Thread 0x000000001e2ad800 nmethod 772 0x0000000002d2ec50 code [0x0000000002d2ee20, 0x0000000002d2f588]
|
||||
Event: 0.422 Thread 0x000000001e2ad800 773 3 java.nio.Bits::getShort (18 bytes)
|
||||
|
||||
GC Heap History (0 events):
|
||||
No events
|
||||
|
||||
Deoptimization events (8 events):
|
||||
Event: 0.220 Thread 0x0000000002842800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002b6b048 method=java.lang.String.indexOf([CII[CIII)I @ 3
|
||||
Event: 0.303 Thread 0x0000000002842800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002c45e44 method=java.util.HashMap.getNode(ILjava/lang/Object;)Ljava/util/HashMap$Node; @ 129
|
||||
Event: 0.324 Thread 0x0000000002842800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002c8cf54 method=java.nio.charset.CoderResult.isOverflow()Z @ 5
|
||||
Event: 0.331 Thread 0x0000000002842800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002c99b34 method=sun.nio.cs.StreamDecoder.implRead([CII)I @ 71
|
||||
Event: 0.358 Thread 0x0000000002842800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002ca24bc method=java.io.Reader.read()I @ 12
|
||||
Event: 0.360 Thread 0x0000000002842800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002cc20b0 method=sun.nio.cs.StreamDecoder.implRead([CII)I @ 197
|
||||
Event: 0.388 Thread 0x0000000002842800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000000002c4e89c method=java.util.HashMap.getNode(ILjava/lang/Object;)Ljava/util/HashMap$Node; @ 129
|
||||
Event: 0.393 Thread 0x0000000002842800 Uncommon trap: reason=range_check action=make_not_entrant pc=0x0000000002d053e8 method=sun.reflect.generics.parser.SignatureParser.current()C @ 34
|
||||
|
||||
Classes redefined (0 events):
|
||||
No events
|
||||
|
||||
Internal exceptions (10 events):
|
||||
Event: 0.141 Thread 0x0000000002842800 Exception <a 'java/security/PrivilegedActionException'> (0x000000076c1b2638) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\prims\jvm.cpp, line 1435]
|
||||
Event: 0.141 Thread 0x0000000002842800 Exception <a 'java/security/PrivilegedActionException'> (0x000000076c1b2848) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\prims\jvm.cpp, line 1435]
|
||||
Event: 0.142 Thread 0x0000000002842800 Exception <a 'java/security/PrivilegedActionException'> (0x000000076c1b51b0) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\prims\jvm.cpp, line 1435]
|
||||
Event: 0.142 Thread 0x0000000002842800 Exception <a 'java/security/PrivilegedActionException'> (0x000000076c1b53c0) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\prims\jvm.cpp, line 1435]
|
||||
Event: 0.295 Thread 0x0000000002842800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException'> (0x000000076d0cf7c8) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\runtime\sharedRuntime.cpp, line 605]
|
||||
Event: 0.297 Thread 0x0000000002842800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException'> (0x000000076d0ed080) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\runtime\sharedRuntime.cpp, line 605]
|
||||
Event: 0.302 Thread 0x0000000002842800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException'> (0x000000076d1316c0) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\runtime\sharedRuntime.cpp, line 605]
|
||||
Event: 0.365 Thread 0x0000000002842800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException'> (0x000000076da2fad0) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\runtime\sharedRuntime.cpp, line 605]
|
||||
Event: 0.365 Thread 0x0000000002842800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException'> (0x000000076da31660) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\runtime\sharedRuntime.cpp, line 605]
|
||||
Event: 0.393 Thread 0x0000000002842800 Exception <a 'java/lang/ArrayIndexOutOfBoundsException': 66> (0x000000076dd42260) thrown at [C:\re\workspace\8-2-build-windows-amd64-cygwin\jdk8u181\11358\hotspot\src\share\vm\interpreter\interpreterRuntime.cpp, line 366]
|
||||
|
||||
Events (10 events):
|
||||
Event: 0.420 loading class org/apache/maven/model/profile/activation/OperatingSystemProfileActivator
|
||||
Event: 0.420 loading class org/apache/maven/model/profile/activation/OperatingSystemProfileActivator done
|
||||
Event: 0.421 loading class org/apache/maven/model/profile/activation/PropertyProfileActivator
|
||||
Event: 0.421 loading class org/apache/maven/model/profile/activation/PropertyProfileActivator done
|
||||
Event: 0.421 loading class org/apache/maven/model/superpom/DefaultSuperPomProvider
|
||||
Event: 0.421 loading class org/apache/maven/model/superpom/DefaultSuperPomProvider done
|
||||
Event: 0.421 loading class org/apache/maven/model/superpom/SuperPomProvider
|
||||
Event: 0.421 loading class org/apache/maven/model/superpom/SuperPomProvider done
|
||||
Event: 0.422 loading class org/apache/maven/model/validation/DefaultModelValidator
|
||||
Event: 0.422 loading class org/apache/maven/model/validation/DefaultModelValidator done
|
||||
|
||||
|
||||
Dynamic libraries:
|
||||
0x00007ff6bafb0000 - 0x00007ff6bafe7000 C:\Java\jdk1.8.0_181\bin\java.exe
|
||||
0x00007fffa59d0000 - 0x00007fffa5bc8000 C:\WINDOWS\SYSTEM32\ntdll.dll
|
||||
0x00007fffa4630000 - 0x00007fffa46ef000 C:\WINDOWS\System32\KERNEL32.DLL
|
||||
0x00007fffa36d0000 - 0x00007fffa39a2000 C:\WINDOWS\System32\KERNELBASE.dll
|
||||
0x00007fffa5590000 - 0x00007fffa563e000 C:\WINDOWS\System32\ADVAPI32.dll
|
||||
0x00007fffa4570000 - 0x00007fffa460e000 C:\WINDOWS\System32\msvcrt.dll
|
||||
0x00007fffa54f0000 - 0x00007fffa558c000 C:\WINDOWS\System32\sechost.dll
|
||||
0x00007fffa43e0000 - 0x00007fffa4505000 C:\WINDOWS\System32\RPCRT4.dll
|
||||
0x00007fffa3a20000 - 0x00007fffa3bbd000 C:\WINDOWS\System32\USER32.dll
|
||||
0x00007fffa33d0000 - 0x00007fffa33f2000 C:\WINDOWS\System32\win32u.dll
|
||||
0x00007fffa4ea0000 - 0x00007fffa4ecb000 C:\WINDOWS\System32\GDI32.dll
|
||||
0x00007fffa34e0000 - 0x00007fffa35ef000 C:\WINDOWS\System32\gdi32full.dll
|
||||
0x00007fffa31d0000 - 0x00007fffa326d000 C:\WINDOWS\System32\msvcp_win.dll
|
||||
0x00007fffa30d0000 - 0x00007fffa31d0000 C:\WINDOWS\System32\ucrtbase.dll
|
||||
0x00007fff7b1b0000 - 0x00007fff7b44a000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e\COMCTL32.dll
|
||||
0x00007fffa4d40000 - 0x00007fffa4d72000 C:\WINDOWS\System32\IMM32.DLL
|
||||
0x0000000065e70000 - 0x0000000065f42000 C:\Java\jdk1.8.0_181\jre\bin\msvcr100.dll
|
||||
0x00000000655c0000 - 0x0000000065e62000 C:\Java\jdk1.8.0_181\jre\bin\server\jvm.dll
|
||||
0x00007fffa48c0000 - 0x00007fffa48c8000 C:\WINDOWS\System32\PSAPI.DLL
|
||||
0x00007fff825d0000 - 0x00007fff825d9000 C:\WINDOWS\SYSTEM32\WSOCK32.dll
|
||||
0x00007fff7d0f0000 - 0x00007fff7d117000 C:\WINDOWS\SYSTEM32\WINMM.dll
|
||||
0x00007fff94080000 - 0x00007fff9408a000 C:\WINDOWS\SYSTEM32\VERSION.dll
|
||||
0x00007fffa5640000 - 0x00007fffa56ab000 C:\WINDOWS\System32\WS2_32.dll
|
||||
0x00000000655b0000 - 0x00000000655bf000 C:\Java\jdk1.8.0_181\jre\bin\verify.dll
|
||||
0x0000000065580000 - 0x00000000655a9000 C:\Java\jdk1.8.0_181\jre\bin\java.dll
|
||||
0x0000000065560000 - 0x0000000065576000 C:\Java\jdk1.8.0_181\jre\bin\zip.dll
|
||||
0x00007fffa3bc0000 - 0x00007fffa4303000 C:\WINDOWS\System32\SHELL32.dll
|
||||
0x00007fffa0c80000 - 0x00007fffa1412000 C:\WINDOWS\SYSTEM32\windows.storage.dll
|
||||
0x00007fffa4930000 - 0x00007fffa4c84000 C:\WINDOWS\System32\combase.dll
|
||||
0x00007fffa2b30000 - 0x00007fffa2b60000 C:\WINDOWS\SYSTEM32\Wldp.dll
|
||||
0x00007fffa4c90000 - 0x00007fffa4d3d000 C:\WINDOWS\System32\SHCORE.dll
|
||||
0x00007fffa4310000 - 0x00007fffa4365000 C:\WINDOWS\System32\shlwapi.dll
|
||||
0x00007fffa3010000 - 0x00007fffa302f000 C:\WINDOWS\SYSTEM32\profapi.dll
|
||||
0x00007fff893f0000 - 0x00007fff893fa000 D:\Installation directory\apache-maven-3.8.1\lib\jansi-native\windows64\jansi.dll
|
||||
|
||||
VM Arguments:
|
||||
jvm_args: -Dclassworlds.conf=D:\Installation directory\apache-maven-3.8.1\bin\..\bin\m2.conf -Dmaven.home=D:\Installation directory\apache-maven-3.8.1\bin\.. -Dlibrary.jansi.path=D:\Installation directory\apache-maven-3.8.1\bin\..\lib\jansi-native -Dmaven.multiModuleProjectDirectory=D:\file store\ÏîÄ¿´úÂë\Àϰå¶þÆÚ\java_git
|
||||
java_command: org.codehaus.plexus.classworlds.launcher.Launcher package -DskipTests
|
||||
java_class_path (initial): D:\Installation directory\apache-maven-3.8.1\bin\..\boot\plexus-classworlds-2.6.0.jar
|
||||
Launcher Type: SUN_STANDARD
|
||||
|
||||
Environment Variables:
|
||||
JAVA_HOME=C:\Java\jdk1.8.0_181
|
||||
JRE_HOME=C:\Java\jdk1.8.0_181\jre
|
||||
CLASSPATH=.;C:\Java\jdk1.8.0_181\lib\dt.jar;C:\Java\jdk1.8.0_181\lib\tools.jar;
|
||||
PATH=C:\Program Files\AdoptOpenJDK\jdk-8.0.282.8-hotspot\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;D:\Installation directory\VMware\bin\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\ZeroTier\One\;%FMS_HOME%\lib;C:\Program Files\dotnet\;C:\WINDOWS\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;D:\Tomcat8.5\apache-tomcat-8.5.73;C:\Java\jdk1.8.0_181\bin;C:\Java\jdk1.8.0_181\jre\bin;D:\Installation directory\apache-maven-3.8.1\bin;C:\Program Files\Git\cmd;C:\Users\upaad\AppData\Local\Microsoft\WindowsApps;D:\Installation directory\VSCode\Microsoft VS Code\bin;C:\Users\upaad\.dotnet\tools;C:\Users\upaad\AppData\Local\JetBrains\Toolbox\scripts;
|
||||
USERNAME=upaad
|
||||
OS=Windows_NT
|
||||
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 140 Stepping 1, GenuineIntel
|
||||
|
||||
|
||||
|
||||
--------------- S Y S T E M ---------------
|
||||
|
||||
OS: Windows 10.0 , 64 bit Build 19041 (10.0.19041.2251)
|
||||
|
||||
CPU:total 8 (initial active 8) (4 cores per cpu, 2 threads per core) family 6 model 140 stepping 1, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, 3dnowpref, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2, adx
|
||||
|
||||
Memory: 4k page, physical 16571704k(872088k free), swap 22029804k(5164k free)
|
||||
|
||||
vm_info: Java HotSpot(TM) 64-Bit Server VM (25.181-b13) for windows-amd64 JRE (1.8.0_181-b13), built on Jul 7 2018 04:01:33 by "java_re" with MS VC++ 10.0 (VS2010)
|
||||
|
||||
time: Tue Nov 22 11:01:19 2022
|
||||
elapsed time: 0 seconds (0d 0h 0m 0s)
|
||||
|
@ -0,0 +1,225 @@
|
||||
#!/bin/sh
|
||||
# ----------------------------------------------------------------------------
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Maven2 Start Up Batch script
|
||||
#
|
||||
# Required ENV vars:
|
||||
# ------------------
|
||||
# JAVA_HOME - location of a JDK home dir
|
||||
#
|
||||
# Optional ENV vars
|
||||
# -----------------
|
||||
# M2_HOME - location of maven2's installed home dir
|
||||
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
# e.g. to debug Maven itself, use
|
||||
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
if [ -z "$MAVEN_SKIP_RC" ] ; then
|
||||
|
||||
if [ -f /etc/mavenrc ] ; then
|
||||
. /etc/mavenrc
|
||||
fi
|
||||
|
||||
if [ -f "$HOME/.mavenrc" ] ; then
|
||||
. "$HOME/.mavenrc"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false;
|
||||
darwin=false;
|
||||
mingw=false
|
||||
case "`uname`" in
|
||||
CYGWIN*) cygwin=true ;;
|
||||
MINGW*) mingw=true;;
|
||||
Darwin*) darwin=true
|
||||
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
||||
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
if [ -x "/usr/libexec/java_home" ]; then
|
||||
export JAVA_HOME="`/usr/libexec/java_home`"
|
||||
else
|
||||
export JAVA_HOME="/Library/Java/Home"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
if [ -r /etc/gentoo-release ] ; then
|
||||
JAVA_HOME=`java-config --jre-home`
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$M2_HOME" ] ; then
|
||||
## resolve links - $0 may be a link to maven's home
|
||||
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
|
||||
|
||||
saveddir=`pwd`
|
||||
|
||||
M2_HOME=`dirname "$PRG"`/..
|
||||
|
||||
# make it fully qualified
|
||||
M2_HOME=`cd "$M2_HOME" && pwd`
|
||||
|
||||
cd "$saveddir"
|
||||
# echo Using m2 at $M2_HOME
|
||||
fi
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||
if $cygwin ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --unix "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
|
||||
fi
|
||||
|
||||
# For Migwn, ensure paths are in UNIX format before anything is touched
|
||||
if $mingw ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME="`(cd "$M2_HOME"; pwd)`"
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
|
||||
# TODO classpath?
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
javaExecutable="`which javac`"
|
||||
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
|
||||
# readlink(1) is not available as standard on Solaris 10.
|
||||
readLink=`which readlink`
|
||||
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
|
||||
if $darwin ; then
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
|
||||
else
|
||||
javaExecutable="`readlink -f \"$javaExecutable\"`"
|
||||
fi
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
|
||||
JAVA_HOME="$javaHome"
|
||||
export JAVA_HOME
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$JAVACMD" ] ; then
|
||||
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
|
||||
else
|
||||
JAVACMD="`which java`"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
echo "Error: JAVA_HOME is not defined correctly." >&2
|
||||
echo " We cannot execute $JAVACMD" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
echo "Warning: JAVA_HOME environment variable is not set."
|
||||
fi
|
||||
|
||||
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
||||
|
||||
# traverses directory structure from process work directory to filesystem root
|
||||
# first directory with .mvn subdirectory is considered project base directory
|
||||
find_maven_basedir() {
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "Path not specified to find_maven_basedir"
|
||||
return 1
|
||||
fi
|
||||
|
||||
basedir="$1"
|
||||
wdir="$1"
|
||||
while [ "$wdir" != '/' ] ; do
|
||||
if [ -d "$wdir"/.mvn ] ; then
|
||||
basedir=$wdir
|
||||
break
|
||||
fi
|
||||
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
||||
if [ -d "${wdir}" ]; then
|
||||
wdir=`cd "$wdir/.."; pwd`
|
||||
fi
|
||||
# end of workaround
|
||||
done
|
||||
echo "${basedir}"
|
||||
}
|
||||
|
||||
# concatenates all lines of a file
|
||||
concat_lines() {
|
||||
if [ -f "$1" ]; then
|
||||
echo "$(tr -s '\n' ' ' < "$1")"
|
||||
fi
|
||||
}
|
||||
|
||||
BASE_DIR=`find_maven_basedir "$(pwd)"`
|
||||
if [ -z "$BASE_DIR" ]; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
|
||||
echo $MAVEN_PROJECTBASEDIR
|
||||
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --path --windows "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
||||
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
||||
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
|
||||
fi
|
||||
|
||||
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
exec "$JAVACMD" \
|
||||
$MAVEN_OPTS \
|
||||
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
||||
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
@ -0,0 +1,143 @@
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||
@REM or more contributor license agreements. See the NOTICE file
|
||||
@REM distributed with this work for additional information
|
||||
@REM regarding copyright ownership. The ASF licenses this file
|
||||
@REM to you under the Apache License, Version 2.0 (the
|
||||
@REM "License"); you may not use this file except in compliance
|
||||
@REM with the License. You may obtain a copy of the License at
|
||||
@REM
|
||||
@REM http://www.apache.org/licenses/LICENSE-2.0
|
||||
@REM
|
||||
@REM Unless required by applicable law or agreed to in writing,
|
||||
@REM software distributed under the License is distributed on an
|
||||
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
@REM KIND, either express or implied. See the License for the
|
||||
@REM specific language governing permissions and limitations
|
||||
@REM under the License.
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Maven2 Start Up Batch script
|
||||
@REM
|
||||
@REM Required ENV vars:
|
||||
@REM JAVA_HOME - location of a JDK home dir
|
||||
@REM
|
||||
@REM Optional ENV vars
|
||||
@REM M2_HOME - location of maven2's installed home dir
|
||||
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
||||
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending
|
||||
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
@REM e.g. to debug Maven itself, use
|
||||
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
||||
@echo off
|
||||
@REM enable echoing my setting MAVEN_BATCH_ECHO to 'on'
|
||||
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
||||
|
||||
@REM set %HOME% to equivalent of $HOME
|
||||
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
||||
|
||||
@REM Execute a user defined script before this one
|
||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
||||
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
|
||||
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
|
||||
:skipRcPre
|
||||
|
||||
@setlocal
|
||||
|
||||
set ERROR_CODE=0
|
||||
|
||||
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
||||
@setlocal
|
||||
|
||||
@REM ==== START VALIDATION ====
|
||||
if not "%JAVA_HOME%" == "" goto OkJHome
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME not found in your environment. >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
:OkJHome
|
||||
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
@REM ==== END VALIDATION ====
|
||||
|
||||
:init
|
||||
|
||||
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
||||
@REM Fallback to current working directory if not found.
|
||||
|
||||
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
||||
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
||||
|
||||
set EXEC_DIR=%CD%
|
||||
set WDIR=%EXEC_DIR%
|
||||
:findBaseDir
|
||||
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
||||
cd ..
|
||||
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
||||
set WDIR=%CD%
|
||||
goto findBaseDir
|
||||
|
||||
:baseDirFound
|
||||
set MAVEN_PROJECTBASEDIR=%WDIR%
|
||||
cd "%EXEC_DIR%"
|
||||
goto endDetectBaseDir
|
||||
|
||||
:baseDirNotFound
|
||||
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
||||
cd "%EXEC_DIR%"
|
||||
|
||||
:endDetectBaseDir
|
||||
|
||||
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
||||
|
||||
@setlocal EnableExtensions EnableDelayedExpansion
|
||||
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
||||
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
||||
|
||||
:endReadAdditionalConfig
|
||||
|
||||
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||
|
||||
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
||||
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
||||
if ERRORLEVEL 1 goto error
|
||||
goto end
|
||||
|
||||
:error
|
||||
set ERROR_CODE=1
|
||||
|
||||
:end
|
||||
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
||||
|
||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
|
||||
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
|
||||
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
|
||||
:skipRcPost
|
||||
|
||||
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
||||
if "%MAVEN_BATCH_PAUSE%" == "on" pause
|
||||
|
||||
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
|
||||
|
||||
exit /B %ERROR_CODE%
|
@ -0,0 +1,380 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>com.pjb</groupId>
|
||||
<artifactId>springboot-jjwt</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>springboot-jjwt</name>
|
||||
<description>Demo project for Spring Boot</description>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.3.RELEASE</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<java.version>1.8</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger2</artifactId>
|
||||
<version>2.9.2</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui -->
|
||||
<dependency>
|
||||
<groupId>io.springfox</groupId>
|
||||
<artifactId>springfox-swagger-ui</artifactId>
|
||||
<version>2.9.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.mybatis.spring.boot</groupId>-->
|
||||
<!-- <artifactId>mybatis-spring-boot-starter</artifactId>-->
|
||||
<!-- <version>1.3.2</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.0.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.47</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt</artifactId>
|
||||
<version>0.9.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.auth0</groupId>
|
||||
<artifactId>java-jwt</artifactId>
|
||||
<version>3.4.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.oracle</groupId>
|
||||
<artifactId>ojdbc8</artifactId>
|
||||
<version>12.2.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>2.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>fccclient</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>fscclient</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>httpcore</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>httpmime</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaAdministrationStrong</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaAiStrong</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaAllocationsStrong</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaBomStrong</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaBusinessModelerStrong</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaCadBomAlignmentStrong</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaCadStrong</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaCaeStrong</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaCalendarManagementStrong</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaChangeManagementStrong</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaClassificationStrong</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaClient</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaCommon</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaConfigurationStrong</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaCoreLoose</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaCoreStrong</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaDocumentManagementStrong</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaImportExportStrong</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaQueryStrong</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaStrongModel</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaWorkflowStrong</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>xercesImpl</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>xml-apis</artifactId>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>teamcenter</groupId>
|
||||
<artifactId>TcSoaManufacturingStrong</artifactId>
|
||||
<version>13.1.0</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.16.22</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-logging</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>4.1.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.7.22</version>
|
||||
</dependency>
|
||||
<!-- JSONObject对象依赖的jar包 -->
|
||||
<dependency>
|
||||
<groupId>commons-beanutils</groupId>
|
||||
<artifactId>commons-beanutils</artifactId>
|
||||
<version>1.9.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
<version>3.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-lang</groupId>
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<version>2.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-logging</groupId>
|
||||
<artifactId>commons-logging</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.ezmorph</groupId>
|
||||
<artifactId>ezmorph</artifactId>
|
||||
<version>1.0.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.json-lib</groupId>
|
||||
<artifactId>json-lib</artifactId>
|
||||
<version>2.2.3</version>
|
||||
<classifier>jdk15</classifier><!-- 指定jdk版本 -->
|
||||
</dependency>
|
||||
<!-- Json依赖架包下载 -->
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>3.14.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.lingala.zip4j</groupId>
|
||||
<artifactId>zip4j</artifactId>
|
||||
<version>2.9.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.8.9</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>KH Interface Services v0.1</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<classpathPrefix>lib/</classpathPrefix>
|
||||
<mainClass>com.pjb.springbootjjwt.SpringbootJjwtApplication</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
</project>
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,39 @@
|
||||
package com.pjb.springbootjjwt;
|
||||
|
||||
import com.teamcenter.clientx.AppXSession;
|
||||
import com.teamcenter.soa.client.model.strong.User;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.pjb.springbootjjwt.mapper")
|
||||
public class SpringbootJjwtApplication {
|
||||
public static String TC_URL;
|
||||
public static String TC_USER;
|
||||
public static String TC_PWD;
|
||||
public static String TC_FMSURL;
|
||||
public static String TC_FCCCACH;
|
||||
public static String ADDRESS;
|
||||
public static String CAD_EXE;
|
||||
public static String CAD_PATH;
|
||||
public static String READ_CAD_EXE;
|
||||
public static String CHECK_CAD_EXE;
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
ConfigurableApplicationContext contenxt = SpringApplication.run(SpringbootJjwtApplication.class, args);
|
||||
TC_URL = contenxt.getEnvironment().getProperty("teamcenter.url");
|
||||
TC_USER = contenxt.getEnvironment().getProperty("teamcenter.user");
|
||||
TC_PWD = contenxt.getEnvironment().getProperty("teamcenter.pwd");
|
||||
TC_FMSURL = contenxt.getEnvironment().getProperty("teamcenter.fmsurl");
|
||||
TC_FCCCACH = contenxt.getEnvironment().getProperty("teamcenter.fcccache");
|
||||
ADDRESS = contenxt.getEnvironment().getProperty("teamcenter.address");
|
||||
CAD_EXE = contenxt.getEnvironment().getProperty("teamcenter.cadexe");
|
||||
CAD_PATH = contenxt.getEnvironment().getProperty("teamcenter.cadpath");
|
||||
READ_CAD_EXE = contenxt.getEnvironment().getProperty("teamcenter.readcadexe");
|
||||
CHECK_CAD_EXE = contenxt.getEnvironment().getProperty("teamcenter.checkcadexe");
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.pjb.springbootjjwt.annotation;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
import static java.lang.annotation.RetentionPolicy.RUNTIME;
|
||||
|
||||
/**
|
||||
* @description:
|
||||
* @param: * @param null
|
||||
* @return:
|
||||
* @author: Jiay
|
||||
* @date: 2022-5-25 13:26
|
||||
*/
|
||||
@Documented
|
||||
@Constraint(validatedBy = com.pjb.springbootjjwt.annotation.DateTimeValueValidator .class)
|
||||
@Target({ElementType.FIELD, ElementType.PARAMETER})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface DateTimeValue {
|
||||
|
||||
String message() default "日期时间格式不正确,正确格式应为" + DatePattern.NORM_DATETIME_PATTERN;
|
||||
|
||||
String pattern() default DatePattern.NORM_DATETIME_PATTERN;
|
||||
|
||||
Class[] groups() default {};
|
||||
|
||||
Class<? extends Payload>[] payload() default {};
|
||||
|
||||
@Target({ElementType.FIELD, ElementType.PARAMETER})
|
||||
@Retention(RUNTIME)
|
||||
@Documented
|
||||
@interface List {
|
||||
com.pjb.springbootjjwt.annotation.DateTimeValue[] value();
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.pjb.springbootjjwt.annotation;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
/**
|
||||
* @description:
|
||||
* @param: * @param null
|
||||
* @return:
|
||||
* @author: Jiay
|
||||
* @date: 2022-5-25 13:04
|
||||
*/
|
||||
public class DateTimeValueValidator implements ConstraintValidator<DateTimeValue, String> {
|
||||
|
||||
private String pattern;
|
||||
|
||||
@Override
|
||||
public void initialize(DateTimeValue dateTimeValue) {
|
||||
this.pattern = dateTimeValue.pattern();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(String dateTimeValue, ConstraintValidatorContext context) {
|
||||
//为空则放过,因为在此校验之前会加入@NotNull或@NotBlank校验
|
||||
if (StrUtil.isBlank(dateTimeValue)) {
|
||||
return true;
|
||||
}
|
||||
//长度不对直接返回
|
||||
if (dateTimeValue.length() != pattern.length()) {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(pattern);
|
||||
LocalDateTime.parse(dateTimeValue, dateTimeFormatter);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.pjb.springbootjjwt.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface PassToken {
|
||||
boolean required() default true;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.pjb.springbootjjwt.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
|
||||
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface UserLoginToken {
|
||||
boolean required() default true;
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.pjb.springbootjjwt.api;
|
||||
|
||||
import com.pjb.springbootjjwt.entity.ImportWFDatasetInput;
|
||||
import com.pjb.springbootjjwt.entity.ResultOa;
|
||||
import com.pjb.springbootjjwt.service.OaService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class OaController {
|
||||
@Autowired
|
||||
OaService service;
|
||||
@PostMapping("/ImportWFDataset")
|
||||
@ResponseBody
|
||||
public Object importWFDataset(@RequestBody ImportWFDatasetInput importWFDatasetInput){
|
||||
ResultOa result = service.importWFDataset(importWFDatasetInput);
|
||||
return result;
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.pjb.springbootjjwt.config;
|
||||
|
||||
import com.pjb.springbootjjwt.interceptor.AuthenticationInterceptor;
|
||||
import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
||||
|
||||
|
||||
@Configuration
|
||||
public class InterceptorConfig implements WebMvcConfigurer {
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(authenticationInterceptor())
|
||||
.addPathPatterns("/**"); // 拦截所有请求,通过判断是否有 @LoginRequired 注解 决定是否需要登录
|
||||
}
|
||||
@Bean
|
||||
public AuthenticationInterceptor authenticationInterceptor() {
|
||||
return new AuthenticationInterceptor();
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.pjb.springbootjjwt.config;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JsonSerializer;
|
||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
public class MyNullJsonSerializer extends JsonSerializer {
|
||||
|
||||
@Override
|
||||
public void serialize(Object o, JsonGenerator jsonGenerator, SerializerProvider serializerProvider)
|
||||
throws IOException, JsonProcessingException {
|
||||
jsonGenerator.writeString("");
|
||||
}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.pjb.springbootjjwt.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
||||
|
||||
@Configuration //说明这是一个配置类
|
||||
@EnableSwagger2// 该注解开启Swagger2的自动配置
|
||||
public class SwaggerConfig {
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.pjb.springbootjjwt.constant;
|
||||
|
||||
public interface ConfigeType {
|
||||
|
||||
public static final String BJXM_ITEM = "BJXM_ITEM";
|
||||
public static final String BJXM_REV = "BJXM_REV";
|
||||
public static final String BJXM_REV_MASTER = "BJXM_REV_MASTER";
|
||||
public static final String XJXXD_ITEM = "XJXXD_ITEM";
|
||||
public static final String XJXXD_REV = "XJXXD_REV";
|
||||
public static final String XJXXD_REV_MASTER = "XJXXD_REV_MASTER";
|
||||
public static final String BJBGD_ITEM = "BJBGD_ITEM";
|
||||
public static final String BJBGD_REV = "BJBGD_REV";
|
||||
public static final String BJBGD_REV_MASTER = "BJBGD_REV_MASTER";
|
||||
public static final String NPI = "NPI";
|
||||
|
||||
|
||||
public static final String ARRAYS = "ARRAYS";
|
||||
public static final String STRING = "STRING";
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.pjb.springbootjjwt.constant;
|
||||
|
||||
public interface Type {
|
||||
public static final String TOOL_CAD = "LB2_CAD";
|
||||
public static final String TOOL_EXCEL = "MSExcel";
|
||||
|
||||
public static final String FILETYPE_CAD = "LB2_CAD";
|
||||
public static final String FILETYPE_EXCEL = "MSExcelX";
|
||||
|
||||
public static final String REFERENCE_CAD = "LB2_dwg";
|
||||
public static final String REFERENCE_EXCEL = "excel";
|
||||
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.pjb.springbootjjwt.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ClassProperties {
|
||||
int ID; //分类属性ID
|
||||
String value; //分类属性值
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.pjb.springbootjjwt.entity;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CompletenessInfo {
|
||||
@JsonProperty
|
||||
@JSONField(name="PartID")
|
||||
String PartID;
|
||||
@JsonProperty
|
||||
@JSONField(name="PartRevID")
|
||||
String PartRevID;
|
||||
@JsonProperty
|
||||
@JSONField(name="DrawingID")
|
||||
String DrawingID;
|
||||
@JsonProperty
|
||||
@JSONField(name="DrawingRev")
|
||||
String DrawingRev;
|
||||
@JsonProperty
|
||||
@JSONField(name="GXno")
|
||||
String GXno;
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.pjb.springbootjjwt.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ConfigInfo {
|
||||
String key;
|
||||
String tcname;
|
||||
String type;
|
||||
String defaultValue;
|
||||
String propType;
|
||||
String value;
|
||||
List<String> objs;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.pjb.springbootjjwt.entity;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ImportWFDatasetInput {
|
||||
@JsonProperty
|
||||
@JSONField(name="WFuid")
|
||||
String WFuid;
|
||||
@JsonProperty
|
||||
@JSONField(name="docid")
|
||||
String docid;
|
||||
@JsonProperty
|
||||
@JSONField(name="docrevid")
|
||||
String docrevid;
|
||||
@JsonProperty
|
||||
@JSONField(name="url")
|
||||
String url;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.pjb.springbootjjwt.entity;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ProductDrawingInfo {
|
||||
@JsonProperty
|
||||
@JSONField(name="PartID")
|
||||
String PartID;
|
||||
@JsonProperty
|
||||
@JSONField(name="PartRevID")
|
||||
String PartRevID;
|
||||
@JsonProperty
|
||||
@JSONField(name="DrawingID")
|
||||
String DrawingID;
|
||||
@JsonProperty
|
||||
@JSONField(name="DrawingRev")
|
||||
String DrawingRev;
|
||||
@JsonProperty
|
||||
@JSONField(name="File")
|
||||
String File;
|
||||
@JsonProperty
|
||||
@JSONField(name="File2")
|
||||
String File2;
|
||||
@JsonProperty
|
||||
@JSONField(name="File3")
|
||||
String File3;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.pjb.springbootjjwt.entity;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
@Data
|
||||
public class ProductDrawingInput {
|
||||
@JsonProperty
|
||||
@JSONField(name="PartID")
|
||||
String PartID;
|
||||
@JsonProperty
|
||||
@JSONField(name="GXNo")
|
||||
String GXNo;
|
||||
@JsonProperty
|
||||
@JSONField(name="DrawingRev")
|
||||
String DrawingRev;
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.pjb.springbootjjwt.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Result {
|
||||
// String msg;
|
||||
// int success;
|
||||
String code;
|
||||
String message;
|
||||
Object data;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.pjb.springbootjjwt.entity;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ResultOa {
|
||||
String Status;
|
||||
@JsonProperty
|
||||
@JSONField(name="message")
|
||||
String message;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.pjb.springbootjjwt.entity;
|
||||
|
||||
import com.teamcenter.soa.client.model.ModelObject;
|
||||
import com.teamcenter.soa.client.model.strong.ItemRevision;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SearchResult {
|
||||
String msg;
|
||||
ModelObject[] objs;
|
||||
ModelObject obj;
|
||||
List<ItemRevision> revlist;
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package com.pjb.springbootjjwt.entity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class User {
|
||||
String app_secret;
|
||||
String username;
|
||||
String password;
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.pjb.springbootjjwt.entity;
|
||||
|
||||
import com.teamcenter.soa.client.model.ModelObject;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class WorkflowInfo {
|
||||
String workflowName;
|
||||
String workflowTempName;
|
||||
List<ModelObject> workflowTargets;
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package com.pjb.springbootjjwt.entity.input;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CheckDocInput {
|
||||
String last_mod_date01;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.pjb.springbootjjwt.entity.input;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class CompletenessInput {
|
||||
@JsonProperty
|
||||
@JSONField(name="PartID")
|
||||
List<String> PartID;
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.pjb.springbootjjwt.exception;
|
||||
|
||||
import com.pjb.springbootjjwt.utils.LogUtil;
|
||||
|
||||
public class SoaException extends Exception{
|
||||
|
||||
private String message;
|
||||
|
||||
public SoaException(String message){
|
||||
super(message);
|
||||
this.message = message;
|
||||
LogUtil.error(SoaException.class,this);
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.pjb.springbootjjwt.exception;
|
||||
|
||||
import com.pjb.springbootjjwt.utils.LogUtil;
|
||||
|
||||
public class SuccessException extends Exception{
|
||||
private String message;
|
||||
|
||||
public SuccessException(String message){
|
||||
super(message);
|
||||
this.message = message;
|
||||
LogUtil.error(SoaException.class,this);
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.pjb.springbootjjwt.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import javax.xml.crypto.Data;
|
||||
import java.util.Date;
|
||||
|
||||
@Repository
|
||||
public interface MesMapper {
|
||||
int insertKH_LOG(@Param("no") String no,
|
||||
@Param("desc") String desc,
|
||||
@Param("provider") String provider,
|
||||
@Param("caller") String caller,
|
||||
@Param("itemid") String itemid,
|
||||
@Param("revid") String revid,
|
||||
@Param("result") String result,
|
||||
@Param("in") String in,
|
||||
@Param("out") String out,
|
||||
@Param("time") String time);
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
package com.pjb.springbootjjwt.service;
|
||||
|
||||
import com.pjb.springbootjjwt.entity.ProductDrawingInfo;
|
||||
import com.pjb.springbootjjwt.entity.ProductDrawingInput;
|
||||
import com.pjb.springbootjjwt.entity.Result;
|
||||
import com.pjb.springbootjjwt.entity.input.CompletenessInput;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface MesService {
|
||||
Result getProductDrawingInfo(ProductDrawingInput productDrawingInput);
|
||||
Result getCompletenessInfo(CompletenessInput completenessInput);
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
package com.pjb.springbootjjwt.service;
|
||||
|
||||
import com.pjb.springbootjjwt.entity.ImportWFDatasetInput;
|
||||
import com.pjb.springbootjjwt.entity.ResultOa;
|
||||
|
||||
public interface OaService {
|
||||
ResultOa importWFDataset (ImportWFDatasetInput importWFDatasetInput);
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
//public class DemoTest {
|
||||
// /***
|
||||
// * 自定义设置单元格样式**
|
||||
// * @param writer hutool-Excel写入器*
|
||||
// * @param x x_坐标*
|
||||
// * @param y y_坐标*
|
||||
// * @param index 背景色***/
|
||||
// private static void setCellStyle(ExcelWriter writer, int x, int y, short index) {
|
||||
// CellStyle cellStyle = writer.createCellStyle(x, y);
|
||||
// // 填充背景色
|
||||
// cellStyle.setFillForegroundColor(index);
|
||||
// cellStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);// 解决填充背景色没有边框问题
|
||||
// cellStyle.setBorderBottom(BorderStyle.THIN);
|
||||
// cellStyle.setBorderTop(BorderStyle.THIN);
|
||||
// cellStyle.setBorderRight(BorderStyle.THIN);
|
||||
// cellStyle.setBorderLeft(BorderStyle.THIN);}
|
||||
// public static void main(String[] args) {
|
||||
// // 构造测试数据
|
||||
// SapTaxResultTest sapTaxResultTest1 = new SapTaxResultTest("12321432", "发票1", "562.45", "3412354", "1");
|
||||
// SapTaxResultTest sapTaxResultTest2 = new SapTaxResultTest("12321432", "发票2", "562.45", "3412354", "2");
|
||||
// SapTaxResultTest sapTaxResultTest3 = new SapTaxResultTest("12321432", "发票3", "562.45", "3412354", "1");
|
||||
// SapTaxResultTest sapTaxResultTest4 = new SapTaxResultTest("12321432", "发票4", "562.45", "3412354", "1");
|
||||
// SapTaxResultTest sapTaxResultTest5 = new SapTaxResultTest("12321432", "发票5", "562.45", "3412354", "2");
|
||||
// List<SapTaxResultTest> list = CollUtil.newArrayList(sapTaxResultTest1, sapTaxResultTest2, sapTaxResultTest3, sapTaxResultTest4, sapTaxResultTest5);
|
||||
// BigExcelWriter writer = ExcelUtil.getBigWriter("C:/Users/Administrator/Desktop/bzbm/test" + RandomUtil.randomNumbers(2) + ".xlsx", "test表");
|
||||
// // 是否写入表头
|
||||
// writer.write(list, true);// 获取表格有多少列
|
||||
// int rowSize = writer.getColumnCount();// 遍历数据行,设置单元格样式
|
||||
// for (int i = 1; i <= list.size(); i++) {
|
||||
// Row row = writer.getOrCreateRow(i);// 假设 resultFlag 列的索引为
|
||||
// String resultFlag = row.getCell(4).getStringCellValue();
|
||||
// if ("1".equals(resultFlag)) {// 设置行背景颜色
|
||||
// for (int j = 0; j < rowSize; j++) {
|
||||
// setCellStyle(writer, j, i, IndexedColors.RED.getIndex());
|
||||
// }
|
||||
// }
|
||||
// } else if ("2".equals(resultFlag))
|
||||
// {// 设置行背景颜色
|
||||
// for (int j = 0; j < rowSize; j++) {
|
||||
// setCellStyle(writer, j, i, IndexedColors.YELLOW.getIndex());
|
||||
// }
|
||||
// }}// 关闭 writer 以释放内存
|
||||
// writer.close();}
|
||||
//}
|
||||
// }
|
||||
// }
|
@ -0,0 +1,33 @@
|
||||
package com.pjb.springbootjjwt.utils;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
|
||||
public class LogUtil {
|
||||
|
||||
public static void error(Class objClass,String msg) {
|
||||
Logger logger = LoggerFactory.getLogger(objClass);
|
||||
logger.error(msg);
|
||||
}
|
||||
|
||||
public static void error(Class objClass, Throwable throwable) {
|
||||
Logger logger = LoggerFactory.getLogger(objClass);
|
||||
logger.error("发送错误",throwable);
|
||||
}
|
||||
|
||||
public static void info(Class objClass, String msg) {
|
||||
Logger logger = LoggerFactory.getLogger(objClass);
|
||||
logger.info(msg);
|
||||
}
|
||||
|
||||
public static void info(String msg) {
|
||||
Logger logger = LoggerFactory.getLogger(LogUtil.class);
|
||||
logger.info(msg);
|
||||
}
|
||||
|
||||
public static void warn(Class objClass, String msg) {
|
||||
Logger logger = LoggerFactory.getLogger(objClass);
|
||||
logger.warn(msg);
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.pjb.springbootjjwt.utils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
public class MyThread implements Runnable {
|
||||
private InputStream in;
|
||||
public MyThread(InputStream in){
|
||||
this.in = in;
|
||||
}
|
||||
@Override
|
||||
public void run() {
|
||||
try{
|
||||
BufferedReader br = new BufferedReader(new InputStreamReader(in, "GBK"));
|
||||
String line = null;
|
||||
while((line = br.readLine())!=null){
|
||||
LogUtil.info(" inputStream: " + line);
|
||||
}
|
||||
}catch (IOException e){
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
try {
|
||||
in.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.pjb.springbootjjwt.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.pjb.springbootjjwt.entity.Result;
|
||||
import com.pjb.springbootjjwt.entity.ResultOa;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ResultUtils {
|
||||
|
||||
//返回错误信息
|
||||
public static Result errorResult(String msg){
|
||||
Result result = new Result();
|
||||
result.setCode("E");
|
||||
result.setMessage(msg);
|
||||
return result;
|
||||
}
|
||||
//返回错误信息OA
|
||||
public static ResultOa errorResultOa(String msg){
|
||||
ResultOa result = new ResultOa();
|
||||
result.setStatus("F");
|
||||
result.setMessage(msg);
|
||||
return result;
|
||||
}
|
||||
//返回代码错误信息
|
||||
public static Result errorResult(Throwable throwable){
|
||||
Result result = new Result();
|
||||
result.setCode("E");
|
||||
result.setMessage(throwable.getMessage());
|
||||
return result;
|
||||
}
|
||||
//返回代码错误信息OA
|
||||
public static ResultOa errorResultOa(Throwable throwable){
|
||||
ResultOa result = new ResultOa();
|
||||
result.setStatus("F");
|
||||
result.setMessage(throwable.toString());
|
||||
return result;
|
||||
}
|
||||
//返回成功信息
|
||||
public static Result successResult(String msg){
|
||||
Result result = new Result();
|
||||
result.setMessage(msg);
|
||||
return result;
|
||||
}
|
||||
//返回成功信息OA
|
||||
public static ResultOa successResultOa(String msg){
|
||||
ResultOa result = new ResultOa();
|
||||
result.setStatus("S");
|
||||
result.setMessage(msg);
|
||||
return result;
|
||||
}
|
||||
//返回成功信息
|
||||
public static Result successResult(Object obj){
|
||||
Result result = new Result();
|
||||
result.setCode("S");
|
||||
result.setMessage("请求成功");
|
||||
result.setData(JSON.toJSON(obj));
|
||||
return result;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,222 @@
|
||||
package com.pjb.springbootjjwt.utils;
|
||||
|
||||
|
||||
/* Written by Patrick Hoonhout */
|
||||
|
||||
import com.teamcenter.clientx.AppXSession;
|
||||
import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException;
|
||||
import com.teamcenter.services.strong.core.DataManagementService;
|
||||
import com.teamcenter.services.strong.core.SessionService;
|
||||
import com.teamcenter.services.strong.workflow.WorkflowService;
|
||||
import com.teamcenter.services.strong.workflow._2008_06.Workflow.AssignmentLists;
|
||||
import com.teamcenter.services.strong.workflow._2008_06.Workflow.AttachmentInfo;
|
||||
import com.teamcenter.services.strong.workflow._2008_06.Workflow.ContextData;
|
||||
import com.teamcenter.services.strong.workflow._2008_06.Workflow.CreateSignoffInfo;
|
||||
import com.teamcenter.services.strong.workflow._2008_06.Workflow.CreateSignoffs;
|
||||
import com.teamcenter.services.strong.workflow._2008_06.Workflow.InstanceInfo;
|
||||
import com.teamcenter.services.strong.workflow._2008_06.Workflow.Tasks;
|
||||
import com.teamcenter.services.strong.workflow._2008_06.Workflow.Templates;
|
||||
import com.teamcenter.soa.client.model.ModelObject;
|
||||
import com.teamcenter.soa.client.model.ServiceData;
|
||||
import com.teamcenter.soa.client.model.strong.EPMAssignmentList;
|
||||
import com.teamcenter.soa.client.model.strong.EPMJob;
|
||||
import com.teamcenter.soa.client.model.strong.EPMPerformSignoffTask;
|
||||
import com.teamcenter.soa.client.model.strong.EPMResourceList;
|
||||
import com.teamcenter.soa.client.model.strong.EPMReviewTask;
|
||||
import com.teamcenter.soa.client.model.strong.EPMSelectSignoffTask;
|
||||
import com.teamcenter.soa.client.model.strong.EPMSignoffProfile;
|
||||
import com.teamcenter.soa.client.model.strong.EPMTask;
|
||||
import com.teamcenter.soa.client.model.strong.EPMTaskTemplate;
|
||||
import com.teamcenter.soa.client.model.strong.GroupMember;
|
||||
import com.teamcenter.soa.client.model.strong.ItemRevision;
|
||||
import com.teamcenter.soa.client.model.strong.Signoff;
|
||||
import com.teamcenter.soa.client.model.strong.User;
|
||||
import com.teamcenter.soa.client.model.strong.WorkspaceObject;
|
||||
import com.teamcenter.soa.common.ObjectPropertyPolicy;
|
||||
import com.teamcenter.soa.common.PolicyProperty;
|
||||
import com.teamcenter.soa.common.PolicyType;
|
||||
import com.teamcenter.soa.exceptions.NotLoadedException;
|
||||
|
||||
public class WorkFlowUtil {
|
||||
|
||||
// private ItemRevision itemRev;
|
||||
// private static GroupMember grpMember;
|
||||
// private EPMJob job = null;
|
||||
// private User user;
|
||||
|
||||
// private String ItemRevUID = "wNA9ziMB4IElDC";
|
||||
// private String GroupMemberUID = "A9F5GoDs4IElDC";
|
||||
|
||||
// SoaEPMAction
|
||||
public static final String EPM_assign_action = "SOA_EPM_assign_action";
|
||||
public static final String EPM_start_action = "SOA_EPM_start_action";
|
||||
public static final String EPM_complete_action = "SOA_EPM_complete_action";
|
||||
public static final String EPM_skip_action = "SOA_EPM_skip_action";
|
||||
public static final String EPM_suspend_action = "SOA_EPM_suspend_action";
|
||||
public static final String EPM_resume_action = "SOA_EPM_resume_action";
|
||||
public static final String EPM_undo_action = "SOA_EPM_undo_action";
|
||||
public static final String EPM_abort_action = "SOA_EPM_abort_action";
|
||||
public static final String EPM_perform_action = "SOA_EPM_perform_action";
|
||||
public static final String EPM_add_attachment_action = "SOA_EPM_add_attachment_action";
|
||||
public static final String EPM_remove_attachment_action = "SOA_EPM_remove_attachment_action";
|
||||
public static final String EPM_approve_action = "SOA_EPM_approve_action";
|
||||
public static final String EPM_reject_action = "SOA_EPM_reject_action";
|
||||
public static final String EPM_promote_action = "SOA_EPM_promote_action";
|
||||
public static final String EPM_demote_action = "SOA_EPM_demote_action";
|
||||
public static final String EPM_refuse_action = "SOA_EPM_refuse_action";
|
||||
public static final String EPM_assign_approver_action = "SOA_EPM_assign_approver_action";
|
||||
public static final String EPM_notify_action = "SOA_EPM_notify_action";
|
||||
public static final String EPM_no_action = "SOA_EPM_no_action";
|
||||
public static final String EPM_fail_action = "SOA_EPM_fail_action";
|
||||
|
||||
// SoaEPMSupportingValues
|
||||
public static final String EPM_no_decision = "SOA_EPM_no_decision";
|
||||
public static final String EPM_approve = "SOA_EPM_approve";
|
||||
public static final String EPM_reject = "SOA_EPM_reject";
|
||||
public static final String EPM_unset = "SOA_EPM_unset";
|
||||
public static final String EPM_completed = "SOA_EPM_completed";
|
||||
public static final String EPM_unable_to_complete = "SOA_EPM_unable_to_complete";
|
||||
public static final String EPM_true = "SOA_EPM_true";
|
||||
public static final String EPM_false = "SOA_EPM_false";
|
||||
public static final String EPM_no_error = "SOA_EPM_no_error";
|
||||
|
||||
// SignoffAction
|
||||
public static final String EPM_ACTION_UNDEFINED = "SOA_EPM_ACTION_UNDEFINED";
|
||||
public static final String EPM_Review = "SOA_EPM_Review";
|
||||
public static final String EPM_Acknowledge = "SOA_EPM_Acknowledge";
|
||||
public static final String EPM_Notify = "SOA_EPM_Notify";
|
||||
|
||||
// OriginType
|
||||
public static final String EPM_Origin_Undefined = "SOA_EPM_ORIGIN_UNDEFINED";
|
||||
public static final String EPM_Signeoff_Origin_Profile = "SOA_EPM_SIGNOFF_ORIGIN_PROFILE";
|
||||
public static final String EPM_Signoff_Origin_AddressList = "SOA_EPM_SIGNOFF_ORIGIN_ADDRESSLIST";
|
||||
|
||||
public WorkFlowUtil() {
|
||||
// setObjectPolicy();
|
||||
}
|
||||
// This action uses OOTB Workflow "Required Signoff"
|
||||
//修改流程节点用户并且执行流程(仅限审核节点选择用户节点未完成的情况下)
|
||||
public static boolean performAction(AppXSession session, ItemRevision itemRev, String nodeName, String workflowName,
|
||||
GroupMember grpMember) throws Exception {
|
||||
TCUtils.setModelObjectValue(session, itemRev,new String[]{"process_stage_list"});
|
||||
ModelObject[] stageList = itemRev.get_process_stage_list();
|
||||
if (CommonlyUtils.isEmpty(stageList)) throw new Exception("版本上的流程为空!!!");
|
||||
TCUtils.setModelObjectValue(session,stageList, new String[] {"child_tasks","object_name" });
|
||||
ModelObject[] tasks = null;
|
||||
for (ModelObject obj : stageList) {
|
||||
String name = obj.getPropertyObject("object_name").getStringValue();
|
||||
if (workflowName.equals(name)) {
|
||||
tasks = ((EPMTask)obj).get_child_tasks();
|
||||
}
|
||||
}
|
||||
if (tasks == null) throw new Exception("未找到进行中的流程!!!");
|
||||
WorkflowService workflowService = WorkflowService.getService(session.getConnection());
|
||||
for(ModelObject obj : tasks) {
|
||||
TCUtils.setModelObjectValue(session,obj,new String[]{"object_name","child_tasks"});
|
||||
String name = obj.getPropertyObject("object_name").getStringValue();
|
||||
if (!name.equals(nodeName)) continue;
|
||||
if(obj instanceof EPMReviewTask) {
|
||||
EPMTask task = (EPMTask)obj;
|
||||
Signoff signOff = null;
|
||||
ModelObject[] childTasks = task.get_child_tasks();
|
||||
TCUtils.setModelObjectValue(session,childTasks,new String[]{"signoff_profiles"});
|
||||
for(ModelObject child : childTasks) {
|
||||
if(child instanceof EPMSelectSignoffTask) {
|
||||
EPMTask childTask = (EPMTask)child;
|
||||
signOff = createProfileSignOff(workflowService,childTask,grpMember);
|
||||
if(signOff == null)
|
||||
throw new Exception("设置流程节点签发人员失败");
|
||||
if(ServiceDataError(workflowService.performAction(childTask, EPM_complete_action,
|
||||
"SOA complete.", null, EPM_completed, null))) // advance the EPMSelectSignoffTask
|
||||
throw new Exception("执行选人节点任务出现错误");
|
||||
else
|
||||
return true;
|
||||
}
|
||||
// else if(child instanceof EPMPerformSignoffTask) {
|
||||
// TCUtils.dataManagementService.refreshObjects(new ModelObject[]{itemRev,stageList[0],obj,child});
|
||||
// LogUtil.info("4");
|
||||
// EPMTask childTask = (EPMTask)child;
|
||||
// if(signOff != null) {
|
||||
// LogUtil.info("8");
|
||||
// TCUtils.dataManagementService.refreshObjects(new ModelObject[]{itemRev,stageList[0],obj,child});
|
||||
// if(ServiceDataError(TCUtils.workflowService.performAction(childTask, EPM_perform_action,
|
||||
// "SOA approved.", null, EPM_approve, signOff)))
|
||||
// return false;
|
||||
// LogUtil.info("9");
|
||||
// TCUtils.dataManagementService.refreshObjects(new ModelObject[]{itemRev,stageList[0],obj,child});
|
||||
// if(!ServiceDataError(TCUtils.workflowService.performAction(childTask, EPM_complete_action,
|
||||
// "SOA complete.", null, EPM_completed, null))) // advance the EPMPerformSignoffTask
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected static Signoff createProfileSignOff(WorkflowService workflowService,EPMTask task,GroupMember grpMember)
|
||||
throws Exception {
|
||||
// ModelObject[] signoffProfiles = task.get_signoff_profiles();
|
||||
// if(signoffProfiles != null && signoffProfiles.length > 0) {
|
||||
CreateSignoffInfo profileInfo = new CreateSignoffInfo();
|
||||
CreateSignoffs signoff = new CreateSignoffs();
|
||||
profileInfo.signoffAction = EPM_Review;
|
||||
// profileInfo.origin = signoffProfiles[0];
|
||||
profileInfo.origin = null;
|
||||
profileInfo.originType = EPM_Origin_Undefined;
|
||||
// profileInfo.originType = EPM_Signeoff_Origin_Profile;
|
||||
profileInfo.signoffMember = grpMember;
|
||||
signoff.signoffInfo = new CreateSignoffInfo[]{
|
||||
profileInfo };
|
||||
signoff.task = task;
|
||||
ServiceData sData = workflowService.addSignoffs(new CreateSignoffs[]{ signoff });
|
||||
if(!ServiceDataError(sData))
|
||||
{
|
||||
if(sData.sizeOfCreatedObjects() > 0)
|
||||
{
|
||||
ModelObject obj = sData.getCreatedObject(0);
|
||||
if(obj instanceof Signoff)
|
||||
return (Signoff)obj;
|
||||
}
|
||||
}
|
||||
// }
|
||||
return null;
|
||||
}
|
||||
|
||||
protected static boolean ServiceDataError(final ServiceData data) {
|
||||
if(data.sizeOfPartialErrors() > 0)
|
||||
{
|
||||
for(int i = 0; i < data.sizeOfPartialErrors(); i++)
|
||||
{
|
||||
for(String msg : data.getPartialError(i).getMessages())
|
||||
System.out.println(msg);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void setObjectPolicy() {
|
||||
SessionService session = SessionService.getService(AppXSession.getConnection());
|
||||
ObjectPropertyPolicy policy = new ObjectPropertyPolicy();
|
||||
PolicyType itemRevType = new PolicyType("ItemRevision");
|
||||
PolicyProperty property = new PolicyProperty("process_stage_list");
|
||||
property.setModifier(PolicyProperty.WITH_PROPERTIES, true);
|
||||
itemRevType.addProperty(property);
|
||||
policy.addType(itemRevType);
|
||||
PolicyType assignmentListType = new PolicyType("EPMAssignmentList");
|
||||
property = new PolicyProperty("resoruces");
|
||||
property.setModifier(PolicyProperty.WITH_PROPERTIES, true);
|
||||
assignmentListType.addProperty(property);
|
||||
policy.addType(assignmentListType);
|
||||
policy.addType("EPMTask", new String[]{ "object_type", "object_name", "task_type",
|
||||
"task_template", "parent_process" });
|
||||
policy.addType("EPMJob", new String[]{ "root_task" });
|
||||
policy.addType("EPMTaskTemplate", new String[]{ "object_type", "object_name"});
|
||||
policy.addType("EPMAssignmentList", new String[]{ "resoruces"});
|
||||
policy.addType("EPMResourceList", new String[]{ "profiles" });
|
||||
// policy.addType("WorkspaceObject", new String[]{"object_name"});
|
||||
session.setObjectPropertyPolicy(policy);
|
||||
}
|
||||
}
|
@ -0,0 +1,145 @@
|
||||
//==================================================
|
||||
//
|
||||
// Copyright 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
|
||||
//
|
||||
//==================================================
|
||||
|
||||
package com.teamcenter.clientx;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.LineNumberReader;
|
||||
|
||||
import com.teamcenter.schemas.soa._2006_03.exceptions.InvalidCredentialsException;
|
||||
import com.teamcenter.schemas.soa._2006_03.exceptions.InvalidUserException;
|
||||
import com.teamcenter.soa.client.CredentialManager;
|
||||
import com.teamcenter.soa.exceptions.CanceledOperationException;
|
||||
|
||||
/**
|
||||
* The CredentialManager is used by the Teamcenter Services framework to get the
|
||||
* user's credentials when challenged by the server. This can occur after a period
|
||||
* of inactivity and the server has timed-out the user's session, at which time
|
||||
* the client application will need to re-authenticate. The framework will
|
||||
* call one of the getCredentials methods (depending on circumstances) and will
|
||||
* send the SessionService.login service request. Upon successful completion of
|
||||
* the login service request. The last service request (one that caused the challenge)
|
||||
* will be resent.
|
||||
*
|
||||
* The framework will also call the setUserPassword setGroupRole methods when ever
|
||||
* these credentials change, thus allowing this implementation of the CredentialManager
|
||||
* to cache these values so prompting of the user is not required for re-authentication.
|
||||
*
|
||||
*/
|
||||
public class AppXCredentialManager implements CredentialManager
|
||||
{
|
||||
|
||||
private String name = null;
|
||||
private String password = null;
|
||||
private String group = ""; // default group
|
||||
private String role = ""; // default role
|
||||
private String discriminator = "SoaAppX"; // always connect same user
|
||||
// to same instance of server
|
||||
|
||||
/**
|
||||
* Return the type of credentials this implementation provides,
|
||||
* standard (user/password) or Single-Sign-On. In this case
|
||||
* Standard credentials are returned.
|
||||
*
|
||||
* @see CredentialManager#getCredentialType()
|
||||
*/
|
||||
public int getCredentialType()
|
||||
{
|
||||
return CredentialManager.CLIENT_CREDENTIAL_TYPE_STD;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prompt's the user for credentials.
|
||||
* This method will only be called by the framework when a login attempt has
|
||||
* failed.
|
||||
*
|
||||
* @see CredentialManager#getCredentials(InvalidCredentialsException)
|
||||
*/
|
||||
public String[] getCredentials(InvalidCredentialsException e)
|
||||
throws CanceledOperationException
|
||||
{
|
||||
System.out.println(e.getMessage());
|
||||
return promptForCredentials();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the cached credentials.
|
||||
* This method will be called when a service request is sent without a valid
|
||||
* session ( session has expired on the server).
|
||||
*
|
||||
* @see CredentialManager#getCredentials(InvalidUserException)
|
||||
*/
|
||||
public String[] getCredentials(InvalidUserException e)
|
||||
throws CanceledOperationException
|
||||
{
|
||||
// Have not logged in yet, should not happen but just in case
|
||||
if (name == null) return promptForCredentials();
|
||||
|
||||
// Return cached credentials
|
||||
String[] tokens = { name, password, group, role, discriminator };
|
||||
return tokens;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cache the group and role
|
||||
* This is called after the SessionService.setSessionGroupMember service
|
||||
* operation is called.
|
||||
*
|
||||
* @see CredentialManager#setGroupRole(String,
|
||||
* String)
|
||||
*/
|
||||
public void setGroupRole(String group, String role)
|
||||
{
|
||||
this.group = group;
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
/**
|
||||
* Cache the User and Password
|
||||
* This is called after the SessionService.login service operation is called.
|
||||
*
|
||||
* @see CredentialManager#setUserPassword(String,
|
||||
* String, String)
|
||||
*/
|
||||
public void setUserPassword(String user, String password, String discriminator)
|
||||
{
|
||||
this.name = user;
|
||||
this.password = password;
|
||||
this.discriminator = discriminator;
|
||||
}
|
||||
|
||||
|
||||
public String[] promptForCredentials()
|
||||
throws CanceledOperationException
|
||||
{
|
||||
try
|
||||
{
|
||||
LineNumberReader reader = new LineNumberReader(new InputStreamReader(System.in));
|
||||
System.out.println("Please enter user credentials (return to quit):");
|
||||
System.out.print("User Name: ");
|
||||
// name = reader.readLine();
|
||||
name = "admin";
|
||||
|
||||
if (name.length() == 0)
|
||||
throw new CanceledOperationException("");
|
||||
|
||||
System.out.print("Password: ");
|
||||
// password = reader.readLine();
|
||||
password = "123";
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
String message = "Failed to get the name and password.\n" + e.getMessage();
|
||||
System.out.println(message);
|
||||
throw new CanceledOperationException(message);
|
||||
}
|
||||
|
||||
String[] tokens = { name, password, group, role, discriminator };
|
||||
return tokens;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,102 @@
|
||||
//==================================================
|
||||
//
|
||||
// Copyright 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
|
||||
//
|
||||
//==================================================
|
||||
|
||||
package com.teamcenter.clientx;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.LineNumberReader;
|
||||
|
||||
import com.teamcenter.schemas.soa._2006_03.exceptions.ConnectionException;
|
||||
import com.teamcenter.schemas.soa._2006_03.exceptions.InternalServerException;
|
||||
import com.teamcenter.schemas.soa._2006_03.exceptions.ProtocolException;
|
||||
import com.teamcenter.soa.client.ExceptionHandler;
|
||||
import com.teamcenter.soa.exceptions.CanceledOperationException;
|
||||
|
||||
/**
|
||||
* Implementation of the ExceptionHandler. For ConnectionExceptions (server
|
||||
* temporarily down .etc) prompts the user to retry the last request. For other
|
||||
* exceptions convert to a RunTime exception.
|
||||
*/
|
||||
public class AppXExceptionHandler implements ExceptionHandler
|
||||
{
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.teamcenter.soa.client.ExceptionHandler#handleException(com.teamcenter.schemas.soa._2006_03.exceptions.InternalServerException)
|
||||
*/
|
||||
public void handleException(InternalServerException ise)
|
||||
{
|
||||
System.out.println("");
|
||||
System.out.println("*****");
|
||||
System.out
|
||||
.println("Exception caught in com.teamcenter.clientx.AppXExceptionHandler.handleException(InternalServerException).");
|
||||
|
||||
LineNumberReader reader = new LineNumberReader(new InputStreamReader(System.in));
|
||||
|
||||
if (ise instanceof ConnectionException)
|
||||
{
|
||||
// ConnectionException are typically due to a network error (server
|
||||
// down .etc) and can be recovered from (the last request can be sent again,
|
||||
// after the problem is corrected).
|
||||
System.out.print("\nThe server returned an connection error.\n" + ise.getMessage()
|
||||
+ "\nDo you wish to retry the last service request?[y/n]");
|
||||
}
|
||||
else
|
||||
if (ise instanceof ProtocolException)
|
||||
{
|
||||
// ProtocolException are typically due to programming errors
|
||||
// (content of HTTP
|
||||
// request is incorrect). These are generally can not be
|
||||
// recovered from.
|
||||
System.out.print("\nThe server returned an protocol error.\n" + ise.getMessage()
|
||||
+ "\nThis is most likely the result of a programming error."
|
||||
+ "\nDo you wish to retry the last service request?[y/n]");
|
||||
}
|
||||
else
|
||||
{
|
||||
System.out.println("\nThe server returned an internal server error.\n"
|
||||
+ ise.getMessage()
|
||||
+ "\nThis is most likely the result of a programming error."
|
||||
+ "\nA RuntimeException will be thrown.");
|
||||
throw new RuntimeException(ise.getMessage());
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
String retry = reader.readLine();
|
||||
// If yes, return to the calling SOA client framework, where the
|
||||
// last service request will be resent.
|
||||
if (retry.equalsIgnoreCase("y") || retry.equalsIgnoreCase("yes")) return;
|
||||
|
||||
throw new RuntimeException("The user has opted not to retry the last request");
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
System.err.println("Failed to read user response.\nA RuntimeException will be thrown.");
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.teamcenter.soa.client.ExceptionHandler#handleException(com.teamcenter.soa.exceptions.CanceledOperationException)
|
||||
*/
|
||||
public void handleException(CanceledOperationException coe)
|
||||
{
|
||||
System.out.println("");
|
||||
System.out.println("*****");
|
||||
System.out.println("Exception caught in com.teamcenter.clientx.AppXExceptionHandler.handleException(CanceledOperationException).");
|
||||
|
||||
// Expecting this from the login tests with bad credentials, and the
|
||||
// AnyUserCredentials class not
|
||||
// prompting for different credentials
|
||||
throw new RuntimeException(coe);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
//==================================================
|
||||
//
|
||||
// Copyright 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
|
||||
//
|
||||
//==================================================
|
||||
|
||||
package com.teamcenter.clientx;
|
||||
|
||||
|
||||
import com.teamcenter.soa.client.model.ModelEventListener;
|
||||
import com.teamcenter.soa.client.model.ModelObject;
|
||||
import com.teamcenter.soa.exceptions.NotLoadedException;
|
||||
|
||||
/**
|
||||
* Implementation of the ChangeListener. Print out all objects that have been updated.
|
||||
*
|
||||
*/
|
||||
public class AppXModelEventListener extends ModelEventListener
|
||||
{
|
||||
|
||||
@Override
|
||||
public void localObjectChange(ModelObject[] objects)
|
||||
{
|
||||
|
||||
if (objects.length == 0) return;
|
||||
System.out.println("");
|
||||
System.out.println("Modified Objects handled in com.teamcenter.clientx.AppXUpdateObjectListener.modelObjectChange");
|
||||
System.out.println("The following objects have been updated in the client data model:");
|
||||
for (int i = 0; i < objects.length; i++)
|
||||
{
|
||||
String uid = objects[i].getUid();
|
||||
String type = objects[i].getTypeObject().getName();
|
||||
String name = "";
|
||||
if (objects[i].getTypeObject().isInstanceOf("WorkspaceObject"))
|
||||
{
|
||||
ModelObject wo = objects[i];
|
||||
try
|
||||
{
|
||||
name = wo.getPropertyObject("object_string").getStringValue();
|
||||
}
|
||||
catch (NotLoadedException e) {} // just ignore
|
||||
}
|
||||
System.out.println(" " + uid + " " + type + " " + name);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void localObjectDelete(String[] uids)
|
||||
{
|
||||
|
||||
if (uids.length == 0)
|
||||
return;
|
||||
|
||||
System.out.println("");
|
||||
System.out.println("Deleted Objects handled in com.teamcenter.clientx.AppXDeletedObjectListener.modelObjectDelete");
|
||||
System.out.println("The following objects have been deleted from the server and removed from the client data model:");
|
||||
for (int i = 0; i < uids.length; i++)
|
||||
{
|
||||
System.out.println(" " + uids[i]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
//==================================================
|
||||
//
|
||||
// Copyright 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
|
||||
//
|
||||
//==================================================
|
||||
|
||||
|
||||
package com.teamcenter.clientx;
|
||||
|
||||
import com.teamcenter.soa.client.model.ErrorStack;
|
||||
import com.teamcenter.soa.client.model.ErrorValue;
|
||||
import com.teamcenter.soa.client.model.PartialErrorListener;
|
||||
|
||||
/**
|
||||
* Implementation of the PartialErrorListener. Print out any partial errors
|
||||
* returned.
|
||||
*
|
||||
*/
|
||||
public class AppXPartialErrorListener implements PartialErrorListener
|
||||
{
|
||||
|
||||
@Override
|
||||
public void handlePartialError(ErrorStack[] stacks)
|
||||
{
|
||||
if (stacks.length == 0) return;
|
||||
|
||||
System.out.println("");
|
||||
System.out.println("*****");
|
||||
System.out.println("Partial Errors caught in com.teamcenter.clientx.AppXPartialErrorListener.");
|
||||
|
||||
|
||||
for (int i = 0; i < stacks.length; i++)
|
||||
{
|
||||
ErrorValue[] errors = stacks[i].getErrorValues();
|
||||
System.out.print("Partial Error for ");
|
||||
|
||||
// The different service implementation may optionally associate
|
||||
// an ModelObject, client ID, or nothing, with each partial error
|
||||
if (stacks[i].hasAssociatedObject())
|
||||
{
|
||||
System.out.println( "object " + stacks[i].getAssociatedObject().getUid() );
|
||||
}
|
||||
else if (stacks[i].hasClientId())
|
||||
{
|
||||
System.out.println( "client id " + stacks[i].getClientId() );
|
||||
}
|
||||
else if (stacks[i].hasClientIndex())
|
||||
System.out.println( "client index " + stacks[i].getClientIndex() );
|
||||
|
||||
|
||||
// Each Partial Error will have one or more contributing error messages
|
||||
for (int j = 0; j < errors.length; j++)
|
||||
{
|
||||
System.out.println(" Code: " + errors[j].getCode() + "\tSeverity: "
|
||||
+ errors[j].getLevel() + "\t" + errors[j].getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
//==================================================
|
||||
//
|
||||
// Copyright 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
|
||||
//
|
||||
//==================================================
|
||||
|
||||
package com.teamcenter.clientx;
|
||||
|
||||
import com.teamcenter.soa.client.RequestListener;
|
||||
|
||||
/**
|
||||
* This implementation of the RequestListener, logs each service request
|
||||
* to the console.
|
||||
*
|
||||
*/
|
||||
public class AppXRequestListener implements RequestListener
|
||||
{
|
||||
|
||||
/**
|
||||
* Called before each request is sent to the server.
|
||||
*/
|
||||
public void serviceRequest ( final Info info )
|
||||
{
|
||||
// will log the service name when done
|
||||
}
|
||||
|
||||
/**
|
||||
* Called after each response from the server.
|
||||
* Log the service operation to the console.
|
||||
*/
|
||||
public void serviceResponse( final Info info )
|
||||
{
|
||||
System.out.println( info.id +": "+info.service+"."+info.operation);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,297 @@
|
||||
//==================================================
|
||||
//
|
||||
// Copyright 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
|
||||
//
|
||||
//==================================================
|
||||
|
||||
package com.teamcenter.clientx;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Vector;
|
||||
|
||||
|
||||
|
||||
import com.teamcenter.schemas.soa._2006_03.exceptions.InvalidCredentialsException;
|
||||
import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException;
|
||||
import com.teamcenter.services.strong.core.DataManagementService;
|
||||
import com.teamcenter.services.strong.core.SessionService;
|
||||
import com.teamcenter.services.strong.core._2006_03.Session.LoginResponse;
|
||||
import com.teamcenter.soa.SoaConstants;
|
||||
import com.teamcenter.soa.client.Connection;
|
||||
import com.teamcenter.soa.client.model.ModelObject;
|
||||
import com.teamcenter.soa.client.model.strong.User;
|
||||
import com.teamcenter.soa.client.model.strong.WorkspaceObject;
|
||||
import com.teamcenter.soa.exceptions.CanceledOperationException;
|
||||
import com.teamcenter.soa.exceptions.NotLoadedException;
|
||||
|
||||
|
||||
public class AppXSession
|
||||
{
|
||||
/**
|
||||
* Single instance of the Connection object that is shared throughout
|
||||
* the application. This Connection object is needed whenever a Service
|
||||
* stub is instantiated.
|
||||
*/
|
||||
private static Connection connection;
|
||||
|
||||
/**
|
||||
* The credentialManager is used both by the Session class and the Teamcenter
|
||||
* Services Framework to get user credentials.
|
||||
*
|
||||
*/
|
||||
private static AppXCredentialManager credentialManager;
|
||||
|
||||
/**
|
||||
* Create an instance of the Session with a connection to the specified
|
||||
* server.
|
||||
*
|
||||
* Add implementations of the ExceptionHandler, PartialErrorListener,
|
||||
* ChangeListener, and DeleteListeners.
|
||||
*
|
||||
* @param host Address of the host to connect to, http://serverName:port/tc
|
||||
*/
|
||||
public AppXSession(String host)
|
||||
{
|
||||
// Create an instance of the CredentialManager, this is used
|
||||
// by the SOA Framework to get the user's credentials when
|
||||
// challenged by the server (session timeout on the web tier).
|
||||
credentialManager = new AppXCredentialManager();
|
||||
|
||||
String protocol=null;
|
||||
String envNameTccs = null;
|
||||
if ( host.startsWith("http") )
|
||||
{
|
||||
protocol = SoaConstants.HTTP;
|
||||
}
|
||||
else if ( host.startsWith("tccs") )
|
||||
{
|
||||
protocol = SoaConstants.TCCS;
|
||||
host = host.trim();
|
||||
int envNameStart = host.indexOf('/') + 2;
|
||||
envNameTccs = host.substring( envNameStart, host.length() );
|
||||
host = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
protocol = SoaConstants.IIOP;
|
||||
}
|
||||
|
||||
|
||||
// Create the Connection object, no contact is made with the server
|
||||
// until a service request is made
|
||||
connection = new Connection(host, credentialManager, SoaConstants.REST, protocol);
|
||||
|
||||
if( protocol == SoaConstants.TCCS )
|
||||
{
|
||||
connection.setOption( Connection.TCCS_ENV_NAME, envNameTccs );
|
||||
}
|
||||
|
||||
|
||||
// Add an ExceptionHandler to the Connection, this will handle any
|
||||
// InternalServerException, communication errors, XML marshaling errors
|
||||
// .etc
|
||||
connection.setExceptionHandler(new AppXExceptionHandler());
|
||||
|
||||
// While the above ExceptionHandler is required, all of the following
|
||||
// Listeners are optional. Client application can add as many or as few Listeners
|
||||
// of each type that they want.
|
||||
|
||||
// Add a Partial Error Listener, this will be notified when ever a
|
||||
// a service returns partial errors.
|
||||
connection.getModelManager().addPartialErrorListener(new AppXPartialErrorListener());
|
||||
|
||||
// Add a Change and Delete Listener, this will be notified when ever a
|
||||
// a service returns model objects that have been updated or deleted.
|
||||
connection.getModelManager().addModelEventListener(new AppXModelEventListener());
|
||||
|
||||
|
||||
// Add a Request Listener, this will be notified before and after each
|
||||
// service request is sent to the server.
|
||||
Connection.addRequestListener( new AppXRequestListener() );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the single Connection object for the application
|
||||
*
|
||||
* @return connection
|
||||
*/
|
||||
public static Connection getConnection()
|
||||
{
|
||||
return connection;
|
||||
}
|
||||
|
||||
|
||||
public User login(String userName,String pwd,String sessionDiscriminator)
|
||||
{
|
||||
// Get the service stub
|
||||
SessionService sessionService = SessionService.getService(connection);
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
// *****************************
|
||||
// Execute the service operation
|
||||
// *****************************
|
||||
LoginResponse out = sessionService.login(userName, pwd,
|
||||
"", "","ZH_CN", sessionDiscriminator);
|
||||
|
||||
|
||||
return out.user;
|
||||
}
|
||||
catch (InvalidCredentialsException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Login to the Teamcenter Server
|
||||
*
|
||||
*/
|
||||
public User login()
|
||||
{
|
||||
// Get the service stub
|
||||
SessionService sessionService = SessionService.getService(connection);
|
||||
|
||||
try
|
||||
{
|
||||
// Prompt for credentials until they are right, or until user
|
||||
// cancels
|
||||
String[] credentials = credentialManager.promptForCredentials();
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
// *****************************
|
||||
// Execute the service operation
|
||||
// *****************************
|
||||
LoginResponse out = sessionService.login(credentials[0], credentials[1],
|
||||
credentials[2], credentials[3],"", credentials[4]);
|
||||
|
||||
return out.user;
|
||||
}
|
||||
catch (InvalidCredentialsException e)
|
||||
{
|
||||
credentials = credentialManager.getCredentials(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
// User canceled the operation, don't need to tell him again
|
||||
catch (CanceledOperationException e) {}
|
||||
|
||||
// Exit the application
|
||||
System.exit(0);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Terminate the session with the Teamcenter Server
|
||||
*
|
||||
*/
|
||||
public void logout()
|
||||
{
|
||||
// Get the service stub
|
||||
SessionService sessionService = SessionService.getService(connection);
|
||||
try
|
||||
{
|
||||
// *****************************
|
||||
// Execute the service operation
|
||||
// *****************************
|
||||
sessionService.logout();
|
||||
}
|
||||
catch (ServiceException e){}
|
||||
}
|
||||
|
||||
/**
|
||||
* Print some basic information for a list of objects
|
||||
*
|
||||
* @param objects
|
||||
*/
|
||||
public static void printObjects(ModelObject[] objects)
|
||||
{
|
||||
if(objects == null)
|
||||
return;
|
||||
|
||||
SimpleDateFormat format = new SimpleDateFormat("M/d/yyyy h:mm a", new Locale("en", "US")); // Simple no time zone
|
||||
|
||||
// Ensure that the referenced User objects that we will use below are loaded
|
||||
getUsers( objects );
|
||||
|
||||
System.out.println("Name\t\tOwner\t\tLast Modified");
|
||||
System.out.println("====\t\t=====\t\t=============");
|
||||
for (int i = 0; i < objects.length; i++)
|
||||
{
|
||||
if(!(objects[i] instanceof WorkspaceObject ))
|
||||
continue;
|
||||
|
||||
WorkspaceObject wo = (WorkspaceObject)objects[i];
|
||||
try
|
||||
{
|
||||
String name = wo.get_object_string();
|
||||
User owner = (User) wo.get_owning_user();
|
||||
Calendar lastModified =wo.get_last_mod_date();
|
||||
|
||||
System.out.println(name + "\t" + owner.get_user_name() + "\t"
|
||||
+ format.format(lastModified.getTime()));
|
||||
}
|
||||
catch (NotLoadedException e)
|
||||
{
|
||||
// Print out a message, and skip to the next item in the folder
|
||||
// Could do a DataManagementService.getProperties call at this point
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("The Object Property Policy ($TC_DATA/soa/policies/Default.xml) is not configured with this property.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static void getUsers( ModelObject[] objects )
|
||||
{
|
||||
if(objects == null)
|
||||
return;
|
||||
|
||||
DataManagementService dmService = DataManagementService.getService(AppXSession.getConnection());
|
||||
|
||||
List<User> unKnownUsers = new Vector<User>();
|
||||
for (int i = 0; i < objects.length; i++)
|
||||
{
|
||||
if(!(objects[i] instanceof WorkspaceObject ))
|
||||
continue;
|
||||
|
||||
WorkspaceObject wo = (WorkspaceObject)objects[i];
|
||||
|
||||
User owner = null;
|
||||
try
|
||||
{
|
||||
owner = (User) wo.get_owning_user();
|
||||
owner.get_user_name();
|
||||
}
|
||||
catch (NotLoadedException e)
|
||||
{
|
||||
if(owner != null)
|
||||
unKnownUsers.add(owner);
|
||||
}
|
||||
}
|
||||
User[] users = (User[])unKnownUsers.toArray(new User[unKnownUsers.size()]);
|
||||
String[] attributes = { "user_name" };
|
||||
|
||||
|
||||
// *****************************
|
||||
// Execute the service operation
|
||||
// *****************************
|
||||
dmService.getProperties(users, attributes);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,297 @@
|
||||
//==================================================
|
||||
//
|
||||
// Copyright 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
|
||||
//
|
||||
//==================================================
|
||||
|
||||
package com.teamcenter.clientx;
|
||||
|
||||
import com.teamcenter.schemas.soa._2006_03.exceptions.InvalidCredentialsException;
|
||||
import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException;
|
||||
import com.teamcenter.services.strong.core.DataManagementService;
|
||||
import com.teamcenter.services.strong.core.SessionService;
|
||||
import com.teamcenter.services.strong.core._2006_03.Session.LoginResponse;
|
||||
import com.teamcenter.soa.SoaConstants;
|
||||
import com.teamcenter.soa.client.Connection;
|
||||
import com.teamcenter.soa.client.model.ModelObject;
|
||||
import com.teamcenter.soa.client.model.strong.User;
|
||||
import com.teamcenter.soa.client.model.strong.WorkspaceObject;
|
||||
import com.teamcenter.soa.exceptions.CanceledOperationException;
|
||||
import com.teamcenter.soa.exceptions.NotLoadedException;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Vector;
|
||||
|
||||
|
||||
public class AppXSessionTekla
|
||||
{
|
||||
/**
|
||||
* Single instance of the Connection object that is shared throughout
|
||||
* the application. This Connection object is needed whenever a Service
|
||||
* stub is instantiated.
|
||||
*/
|
||||
private static Connection connection;
|
||||
|
||||
/**
|
||||
* The credentialManager is used both by the Session class and the Teamcenter
|
||||
* Services Framework to get user credentials.
|
||||
*
|
||||
*/
|
||||
private static AppXCredentialManager credentialManager;
|
||||
|
||||
/**
|
||||
* Create an instance of the Session with a connection to the specified
|
||||
* server.
|
||||
*
|
||||
* Add implementations of the ExceptionHandler, PartialErrorListener,
|
||||
* ChangeListener, and DeleteListeners.
|
||||
*
|
||||
* @param host Address of the host to connect to, http://serverName:port/tc
|
||||
*/
|
||||
public AppXSessionTekla(String host)
|
||||
{
|
||||
// Create an instance of the CredentialManager, this is used
|
||||
// by the SOA Framework to get the user's credentials when
|
||||
// challenged by the server (session timeout on the web tier).
|
||||
credentialManager = new AppXCredentialManager();
|
||||
|
||||
String protocol=null;
|
||||
String envNameTccs = null;
|
||||
if ( host.startsWith("http") )
|
||||
{
|
||||
protocol = SoaConstants.HTTP;
|
||||
}
|
||||
else if ( host.startsWith("tccs") )
|
||||
{
|
||||
protocol = SoaConstants.TCCS;
|
||||
host = host.trim();
|
||||
int envNameStart = host.indexOf('/') + 2;
|
||||
envNameTccs = host.substring( envNameStart, host.length() );
|
||||
host = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
protocol = SoaConstants.IIOP;
|
||||
}
|
||||
|
||||
|
||||
// Create the Connection object, no contact is made with the server
|
||||
// until a service request is made
|
||||
connection = new Connection(host, credentialManager, SoaConstants.REST, protocol);
|
||||
|
||||
if( protocol == SoaConstants.TCCS )
|
||||
{
|
||||
connection.setOption( Connection.TCCS_ENV_NAME, envNameTccs );
|
||||
}
|
||||
|
||||
|
||||
// Add an ExceptionHandler to the Connection, this will handle any
|
||||
// InternalServerException, communication errors, XML marshaling errors
|
||||
// .etc
|
||||
connection.setExceptionHandler(new AppXExceptionHandler());
|
||||
|
||||
// While the above ExceptionHandler is required, all of the following
|
||||
// Listeners are optional. Client application can add as many or as few Listeners
|
||||
// of each type that they want.
|
||||
|
||||
// Add a Partial Error Listener, this will be notified when ever a
|
||||
// a service returns partial errors.
|
||||
connection.getModelManager().addPartialErrorListener(new AppXPartialErrorListener());
|
||||
|
||||
// Add a Change and Delete Listener, this will be notified when ever a
|
||||
// a service returns model objects that have been updated or deleted.
|
||||
connection.getModelManager().addModelEventListener(new AppXModelEventListener());
|
||||
|
||||
|
||||
// Add a Request Listener, this will be notified before and after each
|
||||
// service request is sent to the server.
|
||||
Connection.addRequestListener( new AppXRequestListener() );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the single Connection object for the application
|
||||
*
|
||||
* @return connection
|
||||
*/
|
||||
public static Connection getConnection()
|
||||
{
|
||||
return connection;
|
||||
}
|
||||
|
||||
|
||||
public User login(String userName,String pwd) throws Exception
|
||||
{
|
||||
// Get the service stub
|
||||
SessionService sessionService = SessionService.getService(connection);
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
// *****************************
|
||||
// Execute the service operation
|
||||
// *****************************
|
||||
LoginResponse out = sessionService.login(userName, pwd,
|
||||
"", "","", "Tekla");
|
||||
|
||||
|
||||
return out.user;
|
||||
}
|
||||
catch (InvalidCredentialsException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
throw e;
|
||||
}
|
||||
|
||||
|
||||
//return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Login to the Teamcenter Server
|
||||
*
|
||||
*/
|
||||
public User login()
|
||||
{
|
||||
// Get the service stub
|
||||
SessionService sessionService = SessionService.getService(connection);
|
||||
|
||||
try
|
||||
{
|
||||
// Prompt for credentials until they are right, or until user
|
||||
// cancels
|
||||
String[] credentials = credentialManager.promptForCredentials();
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
// *****************************
|
||||
// Execute the service operation
|
||||
// *****************************
|
||||
LoginResponse out = sessionService.login(credentials[0], credentials[1],
|
||||
credentials[2], credentials[3],"", credentials[4]);
|
||||
|
||||
return out.user;
|
||||
}
|
||||
catch (InvalidCredentialsException e)
|
||||
{
|
||||
credentials = credentialManager.getCredentials(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
// User canceled the operation, don't need to tell him again
|
||||
catch (CanceledOperationException e) {}
|
||||
|
||||
// Exit the application
|
||||
System.exit(0);
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Terminate the session with the Teamcenter Server
|
||||
*
|
||||
*/
|
||||
public void logout()
|
||||
{
|
||||
// Get the service stub
|
||||
SessionService sessionService = SessionService.getService(connection);
|
||||
try
|
||||
{
|
||||
// *****************************
|
||||
// Execute the service operation
|
||||
// *****************************
|
||||
sessionService.logout();
|
||||
}
|
||||
catch (ServiceException e){}
|
||||
}
|
||||
|
||||
/**
|
||||
* Print some basic information for a list of objects
|
||||
*
|
||||
* @param objects
|
||||
*/
|
||||
public static void printObjects(ModelObject[] objects)
|
||||
{
|
||||
if(objects == null)
|
||||
return;
|
||||
|
||||
SimpleDateFormat format = new SimpleDateFormat("M/d/yyyy h:mm a", new Locale("en", "US")); // Simple no time zone
|
||||
|
||||
// Ensure that the referenced User objects that we will use below are loaded
|
||||
getUsers( objects );
|
||||
|
||||
System.out.println("Name\t\tOwner\t\tLast Modified");
|
||||
System.out.println("====\t\t=====\t\t=============");
|
||||
for (int i = 0; i < objects.length; i++)
|
||||
{
|
||||
if(!(objects[i] instanceof WorkspaceObject ))
|
||||
continue;
|
||||
|
||||
WorkspaceObject wo = (WorkspaceObject)objects[i];
|
||||
try
|
||||
{
|
||||
String name = wo.get_object_string();
|
||||
User owner = (User) wo.get_owning_user();
|
||||
Calendar lastModified =wo.get_last_mod_date();
|
||||
|
||||
System.out.println(name + "\t" + owner.get_user_name() + "\t"
|
||||
+ format.format(lastModified.getTime()));
|
||||
}
|
||||
catch (NotLoadedException e)
|
||||
{
|
||||
// Print out a message, and skip to the next item in the folder
|
||||
// Could do a DataManagementService.getProperties call at this point
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("The Object Property Policy ($TC_DATA/soa/policies/Default.xml) is not configured with this property.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static void getUsers( ModelObject[] objects )
|
||||
{
|
||||
if(objects == null)
|
||||
return;
|
||||
|
||||
DataManagementService dmService = DataManagementService.getService(AppXSessionTekla.getConnection());
|
||||
|
||||
List<User> unKnownUsers = new Vector<User>();
|
||||
for (int i = 0; i < objects.length; i++)
|
||||
{
|
||||
if(!(objects[i] instanceof WorkspaceObject ))
|
||||
continue;
|
||||
|
||||
WorkspaceObject wo = (WorkspaceObject)objects[i];
|
||||
|
||||
User owner = null;
|
||||
try
|
||||
{
|
||||
owner = (User) wo.get_owning_user();
|
||||
owner.get_user_name();
|
||||
}
|
||||
catch (NotLoadedException e)
|
||||
{
|
||||
if(owner != null)
|
||||
unKnownUsers.add(owner);
|
||||
}
|
||||
}
|
||||
User[] users = (User[])unKnownUsers.toArray(new User[unKnownUsers.size()]);
|
||||
String[] attributes = { "user_name" };
|
||||
|
||||
|
||||
// *****************************
|
||||
// Execute the service operation
|
||||
// *****************************
|
||||
dmService.getProperties(users, attributes);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.teamcenter.clientx;
|
||||
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.TimeZone;
|
||||
|
||||
public class CommonlyUtils {
|
||||
public static SimpleDateFormat sdf = new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss" );
|
||||
public static SimpleDateFormat fileNameSDF = new SimpleDateFormat ( "yyyyMMddHHmmss" );
|
||||
static {
|
||||
sdf.setTimeZone(TimeZone.getTimeZone("GMT+8"));
|
||||
fileNameSDF.setTimeZone(TimeZone.getTimeZone("GMT+8"));
|
||||
}
|
||||
|
||||
public static String getNowDate(){
|
||||
return fileNameSDF.format(new Date());
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
//==================================================
|
||||
//
|
||||
// Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
|
||||
//
|
||||
//==================================================
|
||||
|
||||
package com.teamcenter.clientx;
|
||||
|
||||
import com.teamcenter.clientx.AppXSession;
|
||||
import com.teamcenter.soa.client.model.strong.User;
|
||||
|
||||
|
||||
/**
|
||||
* This sample client application demonstrates some of the basic features of the
|
||||
* FileManagement service.
|
||||
*
|
||||
*/
|
||||
public class FMS
|
||||
{
|
||||
|
||||
/**
|
||||
* @param args -help or -h will print out a Usage statement
|
||||
*/
|
||||
public static void main(String[] args)
|
||||
{
|
||||
if (args.length > 0)
|
||||
{
|
||||
if (args[0].equals("-help") || args[0].equals("-h"))
|
||||
{
|
||||
System.out.println("usage: java [-Dhost=http://server:port/tc] com.teamcenter.filemanagement.FMS");
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
// Get optional host information
|
||||
String serverHost = "http://10.10.172.37:7001/tc";
|
||||
String host = System.getProperty("host");
|
||||
if (host != null && host.length() > 0)
|
||||
{
|
||||
serverHost = host;
|
||||
}
|
||||
|
||||
AppXSession session = new AppXSession(serverHost);
|
||||
FileManagement fm = new FileManagement();
|
||||
|
||||
// Establish a session with the Teamcenter Server
|
||||
User user = session.login();
|
||||
|
||||
// Upload some files
|
||||
fm.uploadFiles(user);
|
||||
|
||||
session.logout();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,235 @@
|
||||
//==================================================
|
||||
//
|
||||
// Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
|
||||
//
|
||||
//==================================================
|
||||
|
||||
package com.teamcenter.clientx;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.teamcenter.clientx.AppXSession;
|
||||
import com.teamcenter.services.loose.core._2006_03.FileManagement.DatasetFileInfo;
|
||||
import com.teamcenter.services.loose.core._2006_03.FileManagement.GetDatasetWriteTicketsInputData;
|
||||
import com.teamcenter.services.strong.core.DataManagementService;
|
||||
import com.teamcenter.services.strong.core._2006_03.DataManagement.CreateDatasetsResponse;
|
||||
import com.teamcenter.services.strong.core._2008_06.DataManagement.DatasetProperties2;
|
||||
import com.teamcenter.soa.client.FileManagementUtility;
|
||||
import com.teamcenter.soa.client.model.ModelObject;
|
||||
import com.teamcenter.soa.client.model.ServiceData;
|
||||
import com.teamcenter.soa.client.model.strong.Folder;
|
||||
import com.teamcenter.soa.client.model.strong.User;
|
||||
import com.teamcenter.soa.exceptions.NotLoadedException;
|
||||
|
||||
/**
|
||||
* Use the FileManagementService to transfer files
|
||||
*
|
||||
*/
|
||||
public class FileManagement
|
||||
{
|
||||
/** The number of datasets to upload in the multiple file example. */
|
||||
static final int NUMBER_OF_DATASETS = 120;
|
||||
|
||||
/** The number of files per dataset to upload in the multiple file example. */
|
||||
static final int NUMBER_OF_FILES_PER_DATASET = 3;
|
||||
|
||||
/** Upload some files using the FileManagement utilities. */
|
||||
public void uploadFiles(User user)
|
||||
{
|
||||
FileManagementUtility fMSFileManagement = new FileManagementUtility(AppXSession.getConnection());
|
||||
DataManagementService dmService = DataManagementService.getService(AppXSession.getConnection());
|
||||
try
|
||||
{
|
||||
|
||||
Folder home =user.get_home_folder();
|
||||
uploadSingleFile(fMSFileManagement, dmService,home);
|
||||
// uploadMultipleFiles(fMSFileManagement, dmService);
|
||||
} catch (NotLoadedException e) {
|
||||
e.printStackTrace();
|
||||
} finally
|
||||
{
|
||||
// Close FMS connection when done
|
||||
fMSFileManagement.term();
|
||||
}
|
||||
}
|
||||
|
||||
/** Uploads a single file using the FileManagement utilities. */
|
||||
public void uploadSingleFile(final FileManagementUtility fMSFileManagement, final DataManagementService dmService, Folder home)
|
||||
{
|
||||
GetDatasetWriteTicketsInputData[] inputs = { getGetDatasetWriteTicketsInputData(dmService,home) };
|
||||
ServiceData response = fMSFileManagement.putFiles(inputs);
|
||||
|
||||
if (response.sizeOfPartialErrors() > 0)
|
||||
System.out.println("FileManagementService upload returned partial errors: " + response.sizeOfPartialErrors());
|
||||
|
||||
// Delete all objects created
|
||||
ModelObject [] datasets = { inputs[0].dataset };
|
||||
dmService.deleteObjects(datasets);
|
||||
}
|
||||
|
||||
/** Uploads multiple files using the FileManagement utilities. */
|
||||
public void uploadMultipleFiles(final FileManagementUtility fMSFileManagement, final DataManagementService dmService)
|
||||
{
|
||||
GetDatasetWriteTicketsInputData[] inputs = getMultipleGetDatasetWriteTicketsInputData(dmService);
|
||||
ServiceData response = fMSFileManagement.putFiles(inputs);
|
||||
|
||||
if (response.sizeOfPartialErrors() > 0)
|
||||
System.out.println("FileManagementService multiple upload returned partial errors: " + response.sizeOfPartialErrors());
|
||||
|
||||
// Delete all objects created
|
||||
ModelObject[] datasets = new ModelObject[inputs.length];
|
||||
for (int i = 0; i < inputs.length; ++i)
|
||||
{
|
||||
datasets[i] = inputs[i].dataset;
|
||||
}
|
||||
dmService.deleteObjects(datasets);
|
||||
}
|
||||
|
||||
/** @return A single GetDatasetWriteTicketsInputData for uploading ReadMe.txt. */
|
||||
private GetDatasetWriteTicketsInputData getGetDatasetWriteTicketsInputData(final DataManagementService dmService, Folder home)
|
||||
{
|
||||
// Create a Dataset
|
||||
DatasetProperties2 props = new DatasetProperties2();
|
||||
props.clientId = "datasetWriteTixTestClientId";
|
||||
props.type = "Text";
|
||||
props.name = "Sample-FMS-Upload";
|
||||
props.description = "Testing put File";
|
||||
props.container = home;
|
||||
DatasetProperties2[] currProps = { props };
|
||||
|
||||
CreateDatasetsResponse resp = dmService.createDatasets2(currProps);
|
||||
|
||||
// Assume this file is in current dir
|
||||
File file1 = new File("C:\\Users\\85490\\Desktop\\11.txt");
|
||||
|
||||
// Create a file to associate with dataset
|
||||
DatasetFileInfo fileInfo = new DatasetFileInfo();
|
||||
fileInfo.clientId = "file_1";
|
||||
fileInfo.fileName = file1.getAbsolutePath();
|
||||
fileInfo.namedReferencedName = "Text";
|
||||
fileInfo.isText = true;
|
||||
fileInfo.allowReplace = false;
|
||||
DatasetFileInfo[] fileInfos = { fileInfo };
|
||||
|
||||
GetDatasetWriteTicketsInputData inputData = new GetDatasetWriteTicketsInputData();
|
||||
inputData.dataset = resp.output[0].dataset;
|
||||
inputData.createNewVersion = false;
|
||||
inputData.datasetFileInfos = fileInfos;
|
||||
|
||||
return inputData;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return An array of NUMBER_OF_DATASETS GetDatasetWriteTicketsInputData objects
|
||||
* for uploading NUMBER_OF_FILES_PER_DATASET copies of ReadMe.txt to each Dataset.
|
||||
*/
|
||||
private GetDatasetWriteTicketsInputData[] getMultipleGetDatasetWriteTicketsInputData(final DataManagementService dmService)
|
||||
{
|
||||
GetDatasetWriteTicketsInputData[] inputs = new GetDatasetWriteTicketsInputData[NUMBER_OF_DATASETS];
|
||||
DatasetProperties2[] currProps = new DatasetProperties2[inputs.length];
|
||||
|
||||
// Create a bunch of Datasets
|
||||
for (int i = 0; i < inputs.length; ++i)
|
||||
{
|
||||
DatasetProperties2 props = new DatasetProperties2();
|
||||
props.clientId = "datasetWriteTixTestClientId " + i;
|
||||
props.type = "Text";
|
||||
props.name = "Sample-FMS-Upload-" + i;
|
||||
props.description = "Testing Multiple put File";
|
||||
currProps[i] = props;
|
||||
}
|
||||
|
||||
CreateDatasetsResponse resp = dmService.createDatasets2(currProps);
|
||||
|
||||
// Create files to associate with each Dataset
|
||||
for (int i = 0; i < inputs.length; ++i)
|
||||
{
|
||||
DatasetFileInfo fileInfos[] = new DatasetFileInfo[NUMBER_OF_FILES_PER_DATASET];
|
||||
for (int j = 0; j < fileInfos.length; ++j)
|
||||
{
|
||||
DatasetFileInfo fileInfo = new DatasetFileInfo();
|
||||
|
||||
// We apparently cannot upload two files with the same name to
|
||||
// the same Dataset because this creates a relation name
|
||||
// conflict.
|
||||
// File file1 = new File("ReadMe.txt");
|
||||
|
||||
// Create or use this file is in current dir
|
||||
File file1 = new File("ReadMeCopy" + j + ".txt");
|
||||
assureFileCreated(file1);
|
||||
|
||||
fileInfo.clientId = "Dataset " + i + " File " + j;
|
||||
fileInfo.fileName = file1.getAbsolutePath();
|
||||
fileInfo.namedReferencedName = "Text";
|
||||
fileInfo.isText = true;
|
||||
fileInfo.allowReplace = false;
|
||||
fileInfos[j] = fileInfo;
|
||||
}
|
||||
|
||||
GetDatasetWriteTicketsInputData inputData = new GetDatasetWriteTicketsInputData();
|
||||
inputData.dataset = resp.output[i].dataset;
|
||||
inputData.createNewVersion = false;
|
||||
inputData.datasetFileInfos = fileInfos;
|
||||
|
||||
inputs[i] = inputData;
|
||||
}
|
||||
return inputs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assures that the file exists on the file system.
|
||||
* If not, this method copies "ReadMe.txt" to create the file.
|
||||
* @param file1 (File) The file to be created if it does not already exist.
|
||||
*/
|
||||
private void assureFileCreated(final File file1)
|
||||
{
|
||||
if (file1.exists())
|
||||
{
|
||||
return;
|
||||
}
|
||||
FileInputStream fis = null;
|
||||
FileOutputStream fos = null;
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
byte[] buffer = new byte[16384];
|
||||
|
||||
// Assume this file is in current dir
|
||||
fis = new FileInputStream(new File("ReadMe.txt"));
|
||||
// Assume that we can copy it in the current dir
|
||||
fos = new FileOutputStream(file1);
|
||||
|
||||
while (true)
|
||||
{
|
||||
int bytesRead = fis.read(buffer);
|
||||
if (bytesRead <= 0)
|
||||
{
|
||||
// EOF
|
||||
break;
|
||||
}
|
||||
fos.write(buffer, 0, bytesRead);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (fos != null)
|
||||
{
|
||||
fos.close();
|
||||
}
|
||||
if (fis != null)
|
||||
{
|
||||
fis.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException ioe)
|
||||
{
|
||||
System.out.println("Could not copy 'ReadMe.txt' to '" + file1.getName()
|
||||
+ "' - " + ioe.getClass().getSimpleName() + ": " + ioe.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
//==================================================
|
||||
//
|
||||
// Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
|
||||
//
|
||||
//==================================================
|
||||
|
||||
package com.teamcenter.clientx;
|
||||
|
||||
import com.teamcenter.clientx.AppXSession;
|
||||
import com.teamcenter.services.strong.core.DataManagementService;
|
||||
import com.teamcenter.soa.client.model.ModelObject;
|
||||
import com.teamcenter.soa.client.model.strong.Folder;
|
||||
import com.teamcenter.soa.client.model.strong.User;
|
||||
import com.teamcenter.soa.client.model.strong.WorkspaceObject;
|
||||
import com.teamcenter.soa.exceptions.NotLoadedException;
|
||||
|
||||
public class HomeFolder
|
||||
{
|
||||
|
||||
/**
|
||||
* List the contents of the Home folder.
|
||||
*
|
||||
*/
|
||||
public void listHomeFolder(User user)
|
||||
{
|
||||
Folder home = null;
|
||||
WorkspaceObject[] contents = null;
|
||||
|
||||
// Get the service stub
|
||||
DataManagementService dmService = DataManagementService.getService(AppXSession.getConnection());
|
||||
|
||||
try
|
||||
{
|
||||
// User was a primary object returned from the login command
|
||||
// the Object Property Policy should be configured to include the
|
||||
// 'home_folder' property. However the actuall 'home_folder' object
|
||||
// was a secondary object returned from the login request and
|
||||
// therefore does not have any properties associated with it. We will need to
|
||||
// get those properties explicitly with a 'getProperties' service request.
|
||||
home = user.get_home_folder();
|
||||
}
|
||||
catch (NotLoadedException e)
|
||||
{
|
||||
System.out.println(e.getMessage());
|
||||
System.out.println("The Object Property Policy ($TC_DATA/soa/policies/Default.xml) is not configured with this property.");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
ModelObject[] objects = { home };
|
||||
String[] attributes = { "contents" };
|
||||
|
||||
// *****************************
|
||||
// Execute the service operation
|
||||
// *****************************
|
||||
dmService.getProperties(objects, attributes);
|
||||
|
||||
|
||||
// The above getProperties call returns a ServiceData object, but it
|
||||
// just has pointers to the same object we passed into the method, so the
|
||||
// input object have been updated with new property values
|
||||
contents = home.get_contents();
|
||||
}
|
||||
// This should never be thrown, since we just explicitly asked for this
|
||||
// property
|
||||
catch (NotLoadedException e){}
|
||||
|
||||
System.out.println("");
|
||||
System.out.println("Home Folder:");
|
||||
AppXSession.printObjects( contents );
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,263 @@
|
||||
//==================================================
|
||||
//
|
||||
// Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
|
||||
//
|
||||
//==================================================
|
||||
|
||||
package com.teamcenter.clientx;
|
||||
|
||||
|
||||
|
||||
import com.teamcenter.clientx.AppXSession;
|
||||
import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException;
|
||||
|
||||
//Include the Saved Query Service Interface
|
||||
import com.teamcenter.services.strong.query.SavedQueryService;
|
||||
|
||||
// Input and output structures for the service operations
|
||||
// Note: the different namespace from the service interface
|
||||
import com.teamcenter.services.strong.query._2006_03.SavedQuery.GetSavedQueriesResponse;
|
||||
import com.teamcenter.services.strong.query._2007_09.SavedQuery.SavedQueriesResponse;
|
||||
import com.teamcenter.services.strong.query._2008_06.SavedQuery.QueryInput;
|
||||
import com.teamcenter.services.strong.query._2007_09.SavedQuery.QueryResults;
|
||||
|
||||
import com.teamcenter.services.strong.core.DataManagementService;
|
||||
|
||||
import com.teamcenter.soa.client.model.ModelObject;
|
||||
import com.teamcenter.soa.client.model.PropertyDescription;
|
||||
import com.teamcenter.soa.client.model.ServiceData;
|
||||
import com.teamcenter.soa.client.model.Type;
|
||||
import com.teamcenter.soa.client.model.strong.Group;
|
||||
import com.teamcenter.soa.client.model.strong.ImanQuery;
|
||||
import com.teamcenter.soa.client.model.strong.WorkspaceObject;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
|
||||
public class Query
|
||||
{
|
||||
|
||||
/**
|
||||
* Perform a simple query of the database
|
||||
*
|
||||
*/
|
||||
public static ModelObject[] queryItems(String queryName ,String[] entries, String[] values)
|
||||
{
|
||||
|
||||
ImanQuery query = null;
|
||||
|
||||
// Get the service stub.
|
||||
SavedQueryService queryService = SavedQueryService.getService(AppXSession.getConnection());
|
||||
DataManagementService dmService= DataManagementService.getService(AppXSession.getConnection());
|
||||
try
|
||||
{
|
||||
|
||||
// *****************************
|
||||
// Execute the service operation
|
||||
// *****************************
|
||||
GetSavedQueriesResponse savedQueries = queryService.getSavedQueries();
|
||||
|
||||
|
||||
if (savedQueries.queries.length == 0)
|
||||
{
|
||||
System.out.println("There are no saved queries in the system.");
|
||||
return null;
|
||||
}
|
||||
|
||||
// Find one called 'Item Name'
|
||||
for (int i = 0; i < savedQueries.queries.length; i++)
|
||||
{
|
||||
|
||||
if (savedQueries.queries[i].name.equals(queryName))//("__WEB_group"))
|
||||
{
|
||||
query = savedQueries.queries[i].query;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (ServiceException e)
|
||||
{
|
||||
System.out.println("GetSavedQueries service request failed.");
|
||||
System.out.println(e.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
if (query == null)
|
||||
{
|
||||
System.out.println("There is not an 'Item Name' query.");
|
||||
return null;
|
||||
}
|
||||
|
||||
ModelObject[] foundObjs = new ModelObject[0];
|
||||
try
|
||||
{
|
||||
//String[] ss = query.get_query_clauses();
|
||||
//Search for all Items, returning a maximum of 25 objects
|
||||
QueryInput savedQueryInput[] = new QueryInput[1];
|
||||
savedQueryInput[0] = new QueryInput();
|
||||
savedQueryInput[0].query = query;
|
||||
//savedQueryInput[0].maxNumToReturn = 25;
|
||||
//savedQueryInput[0].limitList = new ModelObject[0];
|
||||
savedQueryInput[0].entries = entries;
|
||||
savedQueryInput[0].values = values;
|
||||
|
||||
|
||||
//*****************************
|
||||
//Execute the service operation
|
||||
//*****************************
|
||||
SavedQueriesResponse savedQueryResult = queryService.executeSavedQueries(savedQueryInput);
|
||||
QueryResults found = savedQueryResult.arrayOfResults[0];
|
||||
|
||||
//System.out.println("");
|
||||
//System.out.println("Found Items:");
|
||||
|
||||
// Page through the results 10 at a time
|
||||
// String[] uids = new String[found.objectUIDS.length];
|
||||
// for(int i=0; i< found.objectUIDS.length; i++)
|
||||
// {
|
||||
//int pageSize = (i+10<found.objectUIDS.length)? 10:found.objectUIDS.length-i;
|
||||
|
||||
|
||||
// for(int j=0; j<pageSize; j++)
|
||||
// {
|
||||
// uids[i]= found.objectUIDS[i];
|
||||
// }
|
||||
ServiceData sd = dmService.loadObjects( found.objectUIDS );
|
||||
foundObjs = new ModelObject[ sd.sizeOfPlainObjects()];
|
||||
for( int k =0; k< sd.sizeOfPlainObjects(); k++)
|
||||
{
|
||||
foundObjs[k] = sd.getPlainObject(k);
|
||||
// Group wo = (Group) foundObjs[k];
|
||||
// System.out.println("get_name:"+wo.get_name());
|
||||
}
|
||||
// Group wo = (Group) foundObjs[0];
|
||||
// String s = wo.get_name();
|
||||
// Object[] obj = Arrays.stream(foundObjs).toArray();
|
||||
//AppXSession.printObjects( foundObjs );
|
||||
|
||||
// }
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("ExecuteSavedQuery service request failed.");
|
||||
System.out.println(e.getMessage());
|
||||
return null;
|
||||
}
|
||||
return foundObjs;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Perform a simple query of the database
|
||||
*
|
||||
*/
|
||||
public static ModelObject[] queryItemsForTekla(String queryName ,String[] entries, String[] values)
|
||||
{
|
||||
|
||||
ImanQuery query = null;
|
||||
|
||||
// Get the service stub.
|
||||
SavedQueryService queryService = SavedQueryService.getService(AppXSessionTekla.getConnection());
|
||||
DataManagementService dmService= DataManagementService.getService(AppXSessionTekla.getConnection());
|
||||
try
|
||||
{
|
||||
|
||||
// *****************************
|
||||
// Execute the service operation
|
||||
// *****************************
|
||||
GetSavedQueriesResponse savedQueries = queryService.getSavedQueries();
|
||||
|
||||
|
||||
if (savedQueries.queries.length == 0)
|
||||
{
|
||||
System.out.println("There are no saved queries in the system.");
|
||||
return null;
|
||||
}
|
||||
|
||||
// Find one called 'Item Name'
|
||||
for (int i = 0; i < savedQueries.queries.length; i++)
|
||||
{
|
||||
|
||||
if (savedQueries.queries[i].name.equals(queryName))//("__WEB_group"))
|
||||
{
|
||||
query = savedQueries.queries[i].query;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (ServiceException e)
|
||||
{
|
||||
System.out.println("GetSavedQueries service request failed.");
|
||||
System.out.println(e.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
if (query == null)
|
||||
{
|
||||
System.out.println("There is not an 'Item Name' query.");
|
||||
return null;
|
||||
}
|
||||
|
||||
ModelObject[] foundObjs = new ModelObject[0];
|
||||
try
|
||||
{
|
||||
//String[] ss = query.get_query_clauses();
|
||||
//Search for all Items, returning a maximum of 25 objects
|
||||
QueryInput savedQueryInput[] = new QueryInput[1];
|
||||
savedQueryInput[0] = new QueryInput();
|
||||
savedQueryInput[0].query = query;
|
||||
//savedQueryInput[0].maxNumToReturn = 25;
|
||||
//savedQueryInput[0].limitList = new ModelObject[0];
|
||||
savedQueryInput[0].entries = entries;
|
||||
savedQueryInput[0].values = values;
|
||||
|
||||
|
||||
//*****************************
|
||||
//Execute the service operation
|
||||
//*****************************
|
||||
SavedQueriesResponse savedQueryResult = queryService.executeSavedQueries(savedQueryInput);
|
||||
QueryResults found = savedQueryResult.arrayOfResults[0];
|
||||
|
||||
//System.out.println("");
|
||||
//System.out.println("Found Items:");
|
||||
|
||||
// Page through the results 10 at a time
|
||||
// String[] uids = new String[found.objectUIDS.length];
|
||||
// for(int i=0; i< found.objectUIDS.length; i++)
|
||||
// {
|
||||
//int pageSize = (i+10<found.objectUIDS.length)? 10:found.objectUIDS.length-i;
|
||||
|
||||
|
||||
// for(int j=0; j<pageSize; j++)
|
||||
// {
|
||||
// uids[i]= found.objectUIDS[i];
|
||||
// }
|
||||
ServiceData sd = dmService.loadObjects( found.objectUIDS );
|
||||
foundObjs = new ModelObject[ sd.sizeOfPlainObjects()];
|
||||
for( int k =0; k< sd.sizeOfPlainObjects(); k++)
|
||||
{
|
||||
foundObjs[k] = sd.getPlainObject(k);
|
||||
// Group wo = (Group) foundObjs[k];
|
||||
// System.out.println("get_name:"+wo.get_name());
|
||||
}
|
||||
// Group wo = (Group) foundObjs[0];
|
||||
// String s = wo.get_name();
|
||||
// Object[] obj = Arrays.stream(foundObjs).toArray();
|
||||
//AppXSession.printObjects( foundObjs );
|
||||
|
||||
// }
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println("ExecuteSavedQuery service request failed.");
|
||||
System.out.println(e.getMessage());
|
||||
return null;
|
||||
}
|
||||
return foundObjs;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,228 @@
|
||||
package com.teamcenter.clientx;
|
||||
|
||||
import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException;
|
||||
import com.teamcenter.services.strong.core.DataManagementService;
|
||||
import com.teamcenter.services.strong.core._2006_03.DataManagement;
|
||||
import com.teamcenter.services.strong.query.SavedQueryService;
|
||||
import com.teamcenter.services.strong.query._2006_03.SavedQuery;
|
||||
import com.teamcenter.soa.client.model.ModelObject;
|
||||
import com.teamcenter.soa.client.model.ServiceData;
|
||||
import com.teamcenter.soa.client.model.strong.Group;
|
||||
import com.teamcenter.soa.client.model.strong.ImanQuery;
|
||||
import com.teamcenter.soa.client.model.strong.User;
|
||||
|
||||
public class Utils {
|
||||
|
||||
//Find user using User ID ->String user represent User ID
|
||||
public static ModelObject findUser(String user)
|
||||
|
||||
{
|
||||
|
||||
ImanQuery query = null;
|
||||
|
||||
//SavedQueryService class is in package com.teamcenter.services.strong.query
|
||||
SavedQueryService queryService = SavedQueryService.getService(AppXSession.getConnection());
|
||||
try
|
||||
{
|
||||
SavedQuery.GetSavedQueriesResponse savedQueries = queryService.getSavedQueries();
|
||||
if (savedQueries.queries.length == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
for (int i = 0; i < savedQueries.queries.length; i++)
|
||||
{
|
||||
//__WEB_find_user -> Query in Query builder to find the user
|
||||
if (savedQueries.queries[i].name.equals("__WEB_find_user"))
|
||||
{
|
||||
query = savedQueries.queries[i].query;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch (ServiceException e)
|
||||
{
|
||||
System.out.println(e.getMessage());
|
||||
return null;
|
||||
}
|
||||
if (query == null)
|
||||
{
|
||||
System.out.println("There is not an 'Item Name' query.");
|
||||
return null;
|
||||
}
|
||||
try
|
||||
{
|
||||
com.teamcenter.services.strong.query._2007_06.SavedQuery.SavedQueryInput savedQueryInput[] = new com.teamcenter.services.strong.query._2007_06.SavedQuery.SavedQueryInput[1];
|
||||
savedQueryInput[0] = new com.teamcenter.services.strong.query._2007_06.SavedQuery.SavedQueryInput();
|
||||
savedQueryInput[0].query = query;
|
||||
savedQueryInput[0].maxNumToReturn = 25;
|
||||
savedQueryInput[0].limitListCount = 0;
|
||||
savedQueryInput[0].limitList = new ModelObject[0];
|
||||
savedQueryInput[0].entries = new String[]{"User ID" };//Attribute in Query to search by
|
||||
savedQueryInput[0].values = new String[1];
|
||||
savedQueryInput[0].values[0] = user;//Value for the search attribute
|
||||
savedQueryInput[0].maxNumToInflate = 25;
|
||||
|
||||
//Execute Query to find the User
|
||||
com.teamcenter.services.strong.query._2007_06.SavedQuery.ExecuteSavedQueriesResponse savedQueryResult = queryService.executeSavedQueries(savedQueryInput);
|
||||
com.teamcenter.services.strong.query._2007_06.SavedQuery.SavedQueryResults found = savedQueryResult.arrayOfResults[0];
|
||||
|
||||
// System.out.println("Found Users:");
|
||||
|
||||
ModelObject[] modelObjs = found.objects;
|
||||
|
||||
return modelObjs[0]; //User object
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
System.out.println(e.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
public static ModelObject findGroup(String groupName)
|
||||
{
|
||||
|
||||
ImanQuery query = null;
|
||||
|
||||
SavedQueryService queryService = SavedQueryService.getService(AppXSession.getConnection());
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
SavedQuery.GetSavedQueriesResponse savedQueries = queryService.getSavedQueries();
|
||||
|
||||
if (savedQueries.queries.length == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
for (int i = 0; i < savedQueries.queries.length; i++)
|
||||
{
|
||||
//__WEB_group -> Query in Query builder to find the group
|
||||
|
||||
if (savedQueries.queries[i].name.equals("__WEB_group"))
|
||||
{
|
||||
query = savedQueries.queries[i].query;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
catch (ServiceException e)
|
||||
{
|
||||
|
||||
System.out.println(e.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
if (query == null)
|
||||
{
|
||||
System.out.println("__WEB_group query not found");
|
||||
return null;
|
||||
}
|
||||
try
|
||||
{
|
||||
|
||||
com.teamcenter.services.strong.query._2007_06.SavedQuery.SavedQueryInput savedQueryInput[] = new com.teamcenter.services.strong.query._2007_06.SavedQuery.SavedQueryInput[1];
|
||||
savedQueryInput[0] = new com.teamcenter.services.strong.query._2007_06.SavedQuery.SavedQueryInput();
|
||||
savedQueryInput[0].query = query;
|
||||
savedQueryInput[0].maxNumToReturn = 25;
|
||||
savedQueryInput[0].limitListCount = 0;
|
||||
savedQueryInput[0].limitList = new ModelObject[0];
|
||||
savedQueryInput[0].entries = new String[]{"Name" };//Attribute in Query to search by
|
||||
savedQueryInput[0].values = new String[1];
|
||||
savedQueryInput[0].values[0] = groupName;//Value for the search attribute
|
||||
savedQueryInput[0].maxNumToInflate = 25;
|
||||
|
||||
//Execute Query to find the Group
|
||||
|
||||
com.teamcenter.services.strong.query._2007_06.SavedQuery.ExecuteSavedQueriesResponse savedQueryResult = queryService.executeSavedQueries(savedQueryInput);
|
||||
|
||||
com.teamcenter.services.strong.query._2007_06.SavedQuery.SavedQueryResults found = savedQueryResult.arrayOfResults[0];
|
||||
|
||||
// System.out.println("Found Users:");
|
||||
|
||||
|
||||
ModelObject[] modelObjs = found.objects;
|
||||
|
||||
return modelObjs[0];//Group object
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
System.out.println(e.getMessage());
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public static void changeOwnershipModelObject(ModelObject user, String groupName, ModelObject[] modls) throws Exception
|
||||
{
|
||||
DataManagementService ser1 = DataManagementService.getService( AppXSession.getConnection() );
|
||||
//ModelObject user = findUser( userName ) ;
|
||||
|
||||
if( user != null )
|
||||
{
|
||||
System.out.println("................................owning user found..................................");
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
//The configured EPI-Owning-user is not found in Teamcenter.
|
||||
|
||||
System.out.println("................ EPI-owning user not found ................");
|
||||
|
||||
throw new Exception("Change ownership service: 003.Change ownership service - The configured EPI-owning user is not found in Teamcenter.");
|
||||
|
||||
}
|
||||
ModelObject userGroup = null;
|
||||
if(groupName!=""){
|
||||
userGroup = findGroup( groupName ) ;
|
||||
}else{
|
||||
ser1.getProperties(new ModelObject[]{user},new String[]{"default_group"});
|
||||
userGroup = user.getPropertyObject("default_group").getModelObjectValue();
|
||||
}
|
||||
|
||||
|
||||
if( userGroup != null )
|
||||
{
|
||||
|
||||
System.out.println("................................owning group found..................................");
|
||||
|
||||
}else{
|
||||
|
||||
System.out.println("................ EPI-owning group not found ................");
|
||||
|
||||
throw new Exception("Change ownership service: 004.Change ownership service - The configured EPI-owning group is not found in Teamcenter.");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
DataManagement.ObjectOwner[] ownerData = new DataManagement.ObjectOwner[modls.length];
|
||||
for(int i = 0 ; i <modls.length ;i++) {
|
||||
DataManagement.ObjectOwner ownrObj = new DataManagement.ObjectOwner();
|
||||
|
||||
ownrObj.object = modls[i];
|
||||
ownrObj.group = (Group) userGroup;
|
||||
ownrObj.owner = (User) user;
|
||||
ownerData[i] = ownrObj;
|
||||
}
|
||||
ServiceData returnData = ser1.changeOwnership( ownerData );
|
||||
|
||||
System.out.println( "****************************** Ownership changed successfully ******************************" );
|
||||
|
||||
if(returnData.sizeOfPartialErrors() > 0){
|
||||
|
||||
throw new Exception("Change ownership service: 005.Change ownership service - "+returnData.getPartialError(0).getMessages()[0]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
{
|
||||
"properties": [
|
||||
{
|
||||
"name": "teamcenter.url",
|
||||
"type": "java.lang.String",
|
||||
"description": "Description for teamcenter.url."
|
||||
},
|
||||
{
|
||||
"name": "teamcenter.user",
|
||||
"type": "java.lang.String",
|
||||
"description": "Description for teamcenter.user."
|
||||
},
|
||||
{
|
||||
"name": "teamcenter.pwd",
|
||||
"type": "java.lang.String",
|
||||
"description": "Description for teamcenter.pwd."
|
||||
},
|
||||
{
|
||||
"name": "teamcenter.fmsurl",
|
||||
"type": "java.lang.String",
|
||||
"description": "Description for teamcenter.fmsurl."
|
||||
},
|
||||
{
|
||||
"name": "teamcenter.fcccash",
|
||||
"type": "java.lang.String",
|
||||
"description": "Description for teamcenter.fcccash."
|
||||
}
|
||||
] }
|
@ -0,0 +1,41 @@
|
||||
server:
|
||||
port: 9295
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: oracle.jdbc.OracleDriver
|
||||
url: jdbc:oracle:thin:@172.18.11.38:1521:TC13
|
||||
username: TCPUBLIC
|
||||
password: TCPUBLIC
|
||||
config:
|
||||
activate:
|
||||
on-profile: dev #开发环境
|
||||
mybatis:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: false
|
||||
mapper-locations: classpath:com/pjb/springbootjjwt/mapper/*.xml
|
||||
# mybatis 日志
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
debug: true
|
||||
teamcenter:
|
||||
url: http://172.18.11.38:7001/tc
|
||||
user: admin
|
||||
pwd: admin123
|
||||
fmsurl: http://172.18.11.38:4544
|
||||
fcccache: D:\fcccache
|
||||
address: D:\fcccache\
|
||||
cadexe: acad_process.exe
|
||||
cadpath: D:\config
|
||||
readcadexe: acad_read.exe
|
||||
logging:
|
||||
pattern:
|
||||
file: '%clr(%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{50} - %msg%n)'
|
||||
level:
|
||||
root: info
|
||||
com.pjb.springbootjjwt: debug
|
||||
org:
|
||||
springframework:
|
||||
boot:
|
||||
autoconfigure: info # 日志不打印条件评估报告
|
||||
file: D:\LBLOG\LB_interface.log
|
@ -0,0 +1,52 @@
|
||||
server:
|
||||
port: 9295
|
||||
# tomcat:
|
||||
# uri-encoding: UTF-8
|
||||
# #最小线程数
|
||||
# min-spare-threads: 500
|
||||
# #最大线程数
|
||||
# max-threads: 2500
|
||||
# #最大链接数
|
||||
# max-connections: 6500
|
||||
# #最大等待队列长度
|
||||
# accept-count: 1000
|
||||
# #请求头最大长度kb
|
||||
# max-http-header-size: 1048576
|
||||
# #请请求体最大长度kb
|
||||
# #max-http-post-size: 2097152
|
||||
# #链接建立超时时间
|
||||
# connection-timeout: 120000
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: oracle.jdbc.OracleDriver
|
||||
url: jdbc:oracle:thin:@192.168.90.117:1521:tc
|
||||
username: tc11
|
||||
password: infodba
|
||||
config:
|
||||
activate:
|
||||
on-profile: prod #生产环境
|
||||
mybatis:
|
||||
configuration:
|
||||
map-underscore-to-camel-case: false
|
||||
mapper-locations: classpath:com/pjb/springbootjjwt/mapper/*.xml
|
||||
teamcenter:
|
||||
#测试机配置
|
||||
url: http://192.168.90.118:7001/tc
|
||||
user: infodba
|
||||
pwd: infodba
|
||||
fmsurl: http://192.168.90.116:4544
|
||||
#对内路径
|
||||
fcccache: D:\fcccache
|
||||
address: http://192.168.90.116:19090
|
||||
logging:
|
||||
pattern:
|
||||
file: '%clr(%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{50} - %msg%n)'
|
||||
#file: '${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan}[row-num:%line] %clr(:){faint}: %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}'
|
||||
level:
|
||||
root: info
|
||||
com.pjb.springbootjjwt: info
|
||||
org:
|
||||
springframework:
|
||||
boot:
|
||||
autoconfigure: ERROR # 日志不打印条件评估报告
|
||||
file: D:\LBLOG\LB_interface.log
|
@ -0,0 +1,38 @@
|
||||
server:
|
||||
port: 9295
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: oracle.jdbc.OracleDriver
|
||||
url: jdbc:oracle:thin:@192.168.10.161:1521:TC
|
||||
username: infodba
|
||||
password: infodba
|
||||
config:
|
||||
activate:
|
||||
on-profile: xnj #开发环境
|
||||
mybatis:
|
||||
config-location: classpath:mybatis.xml
|
||||
mapper-locations: classpath:com/pjb/springbootjjwt/mapper/*.xml
|
||||
# mybatis 日志
|
||||
mybatis-plus:
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
debug: true
|
||||
teamcenter:
|
||||
url: http://192.168.10.161:8085/tc
|
||||
user: gengj
|
||||
pwd: 123
|
||||
fmsurl: http://192.168.10.161:4544
|
||||
fcccash: C://123
|
||||
address: C://123/
|
||||
QZBjxmConfig: C:/123/QZBjxmCreate.json
|
||||
logging:
|
||||
pattern:
|
||||
file: '%clr(%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{50} - %msg%n)'
|
||||
file: C://CRMLOG/crm.log
|
||||
level:
|
||||
root: info
|
||||
com.pjb.springbootjjwt: debug
|
||||
org:
|
||||
springframework:
|
||||
boot:
|
||||
autoconfigure: ERROR # 日志不打印条件评估报告
|
@ -0,0 +1,3 @@
|
||||
spring:
|
||||
profiles:
|
||||
active: prod #对应选择那一个环境
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.pjb.springbootjjwt.mapper.MesMapper">
|
||||
<insert id="insertKH_LOG">
|
||||
INSERT into KH_LOG
|
||||
("NO","DESC_","PROVIDER","CALLER","ITEMID","REVID","RESULT","IN_","OUT","TIME")
|
||||
values
|
||||
(#{no},#{desc},#{provider},#{caller},#{itemid},#{revid},#{result},#{in},#{out},#{time})
|
||||
</insert>
|
||||
</mapper>
|
@ -0,0 +1,210 @@
|
||||
import com.teamcenter.clientx.AppXSession;
|
||||
import com.teamcenter.clientx.Query;
|
||||
import com.teamcenter.services.strong.administration.IRMService;
|
||||
import com.teamcenter.services.strong.administration._2006_03.IRM;
|
||||
import com.teamcenter.services.strong.cad.StructureManagementService;
|
||||
import com.teamcenter.services.strong.cad._2007_01.StructureManagement;
|
||||
import com.teamcenter.services.strong.core.DataManagementService;
|
||||
import com.teamcenter.services.strong.core.ReservationService;
|
||||
import com.teamcenter.services.strong.core._2006_03.DataManagement;
|
||||
import com.teamcenter.soa.client.model.ModelObject;
|
||||
import com.teamcenter.soa.client.model.strong.*;
|
||||
|
||||
import java.io.Console;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class TestGetRevisionList {
|
||||
public static void main(String[] args) {
|
||||
|
||||
if (args.length > 0)
|
||||
{
|
||||
if (args[0].equals("-help") || args[0].equals("-h"))
|
||||
{
|
||||
System.out.println("usage: java [-Dhost=http://server:port/tc] com.teamcenter.clientX.AppX");
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
// Get optional host information
|
||||
String serverHost = "http://10.10.172.37:7001/tc";
|
||||
String host = System.getProperty("host");
|
||||
if (host != null && host.length() > 0)
|
||||
{
|
||||
serverHost = host;
|
||||
}
|
||||
|
||||
AppXSession session = new AppXSession(serverHost);
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
User user = session.login();
|
||||
// getRevionAndBomView();
|
||||
// createFolderAndEdit(user);
|
||||
// checkOutAndCheckIn();
|
||||
getprivileges(user);
|
||||
}catch (Exception ex)
|
||||
{
|
||||
System.out.println( ex.getMessage());
|
||||
return ;
|
||||
|
||||
}
|
||||
session.logout();
|
||||
}
|
||||
|
||||
private static void getprivileges(User user) {
|
||||
try
|
||||
{
|
||||
DataManagementService dataManagementService = DataManagementService.getService(AppXSession.getConnection());
|
||||
StructureManagementService smService = StructureManagementService.getService( AppXSession.getConnection());
|
||||
//获取192685产品
|
||||
String[] Entries = {"Item ID"};
|
||||
String[] Values = {"20.01.007.00000010"};
|
||||
ModelObject[] modelObjects = Query.queryItems("Item ID",Entries, Values);
|
||||
dataManagementService.getProperties(modelObjects,new String[]{"item_id","object_name","item_revision","last_release_status","revision_list"});
|
||||
for(ModelObject modelObject : modelObjects) {
|
||||
Item item = (Item) modelObject;
|
||||
//获取最新发布的版本
|
||||
ItemRevision itemRevision = (ItemRevision) item.get_last_release_status();
|
||||
//若不存在 获取最新的版本
|
||||
if (itemRevision == null) {
|
||||
ModelObject[] itemAllRevisions = item.get_revision_list();
|
||||
itemRevision = (ItemRevision) itemAllRevisions[itemAllRevisions.length - 1];
|
||||
}
|
||||
//查询签出状态
|
||||
// itemRevision.get_checked_out();
|
||||
// ReservationService reservationService = ReservationService.getService(AppXSession.getConnection());
|
||||
// //签出
|
||||
// reservationService.checkout(new ModelObject[]{itemRevision},"","");
|
||||
// //签入
|
||||
// reservationService.checkin(new ModelObject[]{itemRevision});
|
||||
|
||||
String[] privilegeNames = new String[] { "READ", "WRITE", "DELETE"};
|
||||
IRMService irmService = IRMService.getService(AppXSession.getConnection());
|
||||
IRM.CheckAccessorPrivilegesResponse resp = irmService.checkAccessorsPrivileges(user,new ModelObject[]{itemRevision}, privilegeNames);
|
||||
System.out.println("");
|
||||
}
|
||||
}catch (Exception ex)
|
||||
{
|
||||
System.out.println( ex.getMessage());
|
||||
return ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private static void checkOutAndCheckIn() {
|
||||
try
|
||||
{
|
||||
DataManagementService dataManagementService = DataManagementService.getService(AppXSession.getConnection());
|
||||
StructureManagementService smService = StructureManagementService.getService( AppXSession.getConnection());
|
||||
//获取192685产品
|
||||
String[] Entries = {"Item ID"};
|
||||
String[] Values = {"20.01.007.00000010"};
|
||||
ModelObject[] modelObjects = Query.queryItems("Item ID",Entries, Values);
|
||||
dataManagementService.getProperties(modelObjects,new String[]{"item_id","object_name","item_revision","last_release_status","revision_list"});
|
||||
for(ModelObject modelObject : modelObjects) {
|
||||
Item item = (Item) modelObject;
|
||||
//获取最新发布的版本
|
||||
ItemRevision itemRevision = (ItemRevision) item.get_last_release_status();
|
||||
//若不存在 获取最新的版本
|
||||
if (itemRevision == null) {
|
||||
ModelObject[] itemAllRevisions = item.get_revision_list();
|
||||
itemRevision = (ItemRevision) itemAllRevisions[itemAllRevisions.length - 1];
|
||||
}
|
||||
// 查询签出状态
|
||||
itemRevision.get_checked_out();
|
||||
ReservationService reservationService = ReservationService.getService(AppXSession.getConnection());
|
||||
//签出
|
||||
reservationService.checkout(new ModelObject[]{itemRevision},"","");
|
||||
//签入
|
||||
reservationService.checkin(new ModelObject[]{itemRevision});
|
||||
}
|
||||
}catch (Exception ex)
|
||||
{
|
||||
System.out.println( ex.getMessage());
|
||||
return ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private static void createFolderAndEdit(User user) {
|
||||
try{
|
||||
//在Home创建文件夹
|
||||
Folder home = user.get_home_folder();
|
||||
DataManagementService dataManagementService = DataManagementService.getService(AppXSession.getConnection());
|
||||
DataManagement.CreateFolderInput createFolderInput = new DataManagement.CreateFolderInput();
|
||||
createFolderInput.name = "测试文件夹";
|
||||
DataManagement.CreateFoldersResponse createFoldersResponse = dataManagementService.createFolders(new DataManagement.CreateFolderInput[]{createFolderInput},home,"");
|
||||
if(createFoldersResponse.serviceData.sizeOfCreatedObjects() == 0){
|
||||
System.out.println("创建失败");
|
||||
return;
|
||||
}
|
||||
//编辑文件夹属性
|
||||
Folder theNewFolder = createFoldersResponse.output[0].folder;
|
||||
com.teamcenter.services.strong.core._2007_01.DataManagement.VecStruct vecStruct = new com.teamcenter.services.strong.core._2007_01.DataManagement.VecStruct();
|
||||
vecStruct.stringVec = new String[]{"测试文件夹(修改后)"};
|
||||
HashMap<String, com.teamcenter.services.strong.core._2007_01.DataManagement.VecStruct> propertyMap = new HashMap<String, com.teamcenter.services.strong.core._2007_01.DataManagement.VecStruct>();
|
||||
//修改的属性和值
|
||||
propertyMap.put("object_name",vecStruct);
|
||||
dataManagementService.setProperties(new ModelObject[]{theNewFolder} , propertyMap );
|
||||
|
||||
|
||||
}catch (Exception ex)
|
||||
{
|
||||
System.out.println( ex.getMessage());
|
||||
return ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static void getRevionAndBomView() {
|
||||
try
|
||||
{
|
||||
DataManagementService dataManagementService = DataManagementService.getService(AppXSession.getConnection());
|
||||
StructureManagementService smService = StructureManagementService.getService( AppXSession.getConnection());
|
||||
//获取192685产品
|
||||
String[] Entries = {"Item ID"};
|
||||
String[] Values = {"20.01.007.00000010"};
|
||||
ModelObject[] modelObjects = Query.queryItems("Item ID",Entries, Values);
|
||||
dataManagementService.getProperties(modelObjects,new String[]{"item_id","object_name","item_revision","last_release_status","revision_list"});
|
||||
for(ModelObject modelObject : modelObjects){
|
||||
Item item = (Item) modelObject;
|
||||
//获取最新发布的版本
|
||||
ItemRevision itemRevision = (ItemRevision) item.get_last_release_status();
|
||||
//若不存在 获取最新的版本
|
||||
if(itemRevision == null){
|
||||
ModelObject[] itemAllRevisions = item.get_revision_list();
|
||||
itemRevision = (ItemRevision) itemAllRevisions[itemAllRevisions.length-1];
|
||||
}
|
||||
//获取BOM
|
||||
StructureManagement.CreateBOMWindowsInfo[] createBOMWindowsInfo = new StructureManagement.CreateBOMWindowsInfo[1];
|
||||
createBOMWindowsInfo[0] = new StructureManagement.CreateBOMWindowsInfo();
|
||||
createBOMWindowsInfo[0].itemRev = itemRevision;
|
||||
StructureManagement.CreateBOMWindowsResponse createBOMWindowsResponse = smService.createBOMWindows(createBOMWindowsInfo);
|
||||
BOMLine topBomLine = (BOMLine) createBOMWindowsResponse.output[0].bomLine;
|
||||
dataManagementService.getProperties(new BOMLine[]{topBomLine},new String[]{"bl_child_lines"});
|
||||
ModelObject[] childrenBomLines = topBomLine.get_bl_child_lines();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}catch (Exception ex)
|
||||
{
|
||||
System.out.println( ex.getMessage());
|
||||
return ;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static StructureManagement.CreateBOMWindowsResponse createBomWindow(ItemRevision itemRev)
|
||||
{
|
||||
StructureManagement.CreateBOMWindowsInfo[] createBOMWindowsInfo = new StructureManagement.CreateBOMWindowsInfo[1];
|
||||
createBOMWindowsInfo[0] = new StructureManagement.CreateBOMWindowsInfo();
|
||||
createBOMWindowsInfo[0].itemRev = itemRev;StructureManagementService smService = StructureManagementService.getService( AppXSession.getConnection() );;
|
||||
StructureManagement.CreateBOMWindowsResponse createBOMWindowsResponse = smService.createBOMWindows(createBOMWindowsInfo);
|
||||
return createBOMWindowsResponse;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue