first commit

main
洪丞进 1 week ago
commit 6f98b1f6fe

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="lib" path="lib/commons-codec.jar"/>
<classpathentry kind="lib" path="lib/commons-httpclient-3.1.jar"/>
<classpathentry kind="lib" path="lib/fccclient.jar"/>
<classpathentry kind="lib" path="lib/fscclient.jar"/>
<classpathentry kind="lib" path="lib/log4j-1.2.13.jar"/>
<classpathentry kind="lib" path="lib/resolver.jar"/>
<classpathentry kind="lib" path="lib/tcmemjavabinding.jar"/>
<classpathentry kind="lib" path="lib/tcserverjavabinding.jar"/>
<classpathentry kind="lib" path="lib/xml-apis.jar"/>
<classpathentry kind="lib" path="lib/xercesImpl.jar"/>
<classpathentry kind="lib" path="lib/commons-logging-1.1.jar"/>
<classpathentry kind="lib" path="lib/commons-net-3.6.jar"/>
<classpathentry kind="lib" path="lib/dom4j-1.6.1.jar"/>
<classpathentry kind="lib" path="lib/iText-5.0.2.jar"/>
<classpathentry kind="lib" path="lib/org.apache.commons.lang_2.3.0.v200803061910.jar"/>
<classpathentry kind="lib" path="tc11soalib/TcSoaAdministrationStrong_11000.2.0.jar"/>
<classpathentry kind="lib" path="tc11soalib/TcSoaAdministrationTypes_11000.2.0.jar"/>
<classpathentry kind="lib" path="tc11soalib/TcSoaClient_11000.2.0.jar"/>
<classpathentry kind="lib" path="tc11soalib/TcSoaCommon_11000.2.0.jar"/>
<classpathentry kind="lib" path="tc11soalib/TcSoaCoreStrong_11000.2.0.jar"/>
<classpathentry kind="lib" path="tc11soalib/TcSoaCoreTypes_11000.2.0.jar"/>
<classpathentry kind="lib" path="tc11soalib/TcSoaQueryStrong_11000.2.0.jar"/>
<classpathentry kind="lib" path="tc11soalib/TcSoaStrongModel_11000.2.0.jar"/>
<classpathentry kind="lib" path="tc11soalib/TcSoaWorkflowStrong_11000.2.0.jar"/>
<classpathentry kind="lib" path="tc11soalib/TcSoaWorkflowTypes_11000.2.0.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

8
.idea/.gitignore vendored

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
# Editor-based HTTP Client requests
/httpRequests/

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="GBK" />
</component>
</project>

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" project-jdk-name="11" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/classes" />
</component>
</project>

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

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

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.connor.signoff.soa</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

@ -0,0 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.6

@ -0,0 +1,96 @@
This sample demonstrates the basic functionality of the Teamcenter Services.
The project can be built with Java SDK 1.7.0, from the command line using Ant(1.7.0), or from
the Eclipse IDE (3.8).
Before running the sample application, you must have a Teamcenter Web Tier server
and Pool Manager up and running.
From the Command line
Prerequisite :- You need to have Ant set up. The Ant bin folder needs to be in your
PATH and ANT_HOME variable pointing to the Ant home directory.
1. Build the application using Ant
>ant -buildfile build.xml
2. Execute the client application
On Windows:
>RunMe http://localhost:7001/tc
On Unix platform:
>./RunMe.sh http://localhost:7001/tc
Substitute the URI of the Teamcenter Web Tier server
In case of running in TCCS mode,instead of http://hostname:port/tc use tccs://<tccs_envname>
From the Eclipse IDE
1. Add ClassPath variable for the root location of the soa_client folder
Open the Preferences dialog (Window --> Preferences ... )
Select the ClassPath Variable tab ( Java --> Build Path --> ClassPath Variables)
Add the variable 'TEAMCENTER_SERVICES_HOME', set it to the root path of the 'soa_client' folder
2. Import the project
Open the Import dialog ( File --> Import... )
Select Existing Project into Workspace (General --> Existing Projects into Workspace )
Click Next, then browse to .../soa_client/java/sample, select Finish
3. Compile the project
If the IDE is not configured to Build Automatically, force a build of the project
4. Execute the client application
Open the Debug/Run dialog ( Run --> Debug ...)
Select the HelloTeamcenter Java Application
The launch is configured to connect to the server on http://localhost:7001/tc. To change this URI, either
Go to the Arguments tab in Run configuration and change value in VM Args
or
Change the value of "org.eclipse.jdt.launching.VM_ARGUMENTS" in HelloTeamcenter.launch file .
Running in TCCS mode
1. To run in TCCS mode, ensure that TCCS and its configuration files are installed and TCCS is
already running.
2. Set the FMS_HOME to correct value and ensure TCCS native libs are in PATH on Windows or LD_LIBRARY_PATH on Unix platforms.
3. Use tccs://<tccs_envname> (TCCS protocol and environment name) as the
host URI instead of http://hostname:port/tc
The source file Hello.java has the main function for the application. This is the
best place to start browsing the code. There are several classes prefixed with
the name AppX (AppXCredentialManager). These classes are implementations of
Teamcenter Services framework interfaces. Each client application is responsible
for providing an implementation to these interfaces:
CredentialManager Used by the framework to re-authenticate as user.
ExceptionHandler Provide a mechanism for the client application to
handle low level exception in the communication framework.
PartialErrorListener Optional listener for notification when a service operation
has returned partial errors.
ModelEventListener Optional listener for notification when a service operation
has returned ModelObject with updated property values,
or when objects have been deleted from the database.
The remaining classes in this sample use a few service operations to demonstrate some
basic features of Teamcenter Services.
Session This class shows how to establish a session with the
Teamcenter Server using the SessionService login and
logout methods. A session must be established before
any other service operation are called.
HomeFolder This class lists the contents of the user's home folder
Query This class performs a simple query.
DataManagement This class creates, revises, and deletes a set of Items
Each of these examples performs the same basic steps
1. Construct the desired service stub.
2. Gather the data for the operation's input arguments,
3. Call the service operation
4. Process the results.
A few of the service operations will make use of the ModelEventListener.
Under normal circumstances the ExeptionHandler and PartialErrorListner will not
be called.

1
bin/.gitignore vendored

@ -0,0 +1 @@
/com/

@ -0,0 +1,40 @@
#==================================================
#
# @<COPYRIGHT>@
#
#==================================================
# ============================================================================ #
# Set the Logging for the entire Web Application. #
# The Level can be DEBUG, INFO, WARN, ERROR, FATAL, or OFF #
# There are two predefined Appenders, TheConsole and AppLogFile #
# ============================================================================ #
log4j.rootLogger = WARN, TheConsole
#log4j.logger.org.apache.commons.httpclient = WARN, TheConsole
# ============================================================================ #
# The "TheConsole" Appender will write the log message to the console #
# (System.out) with the pattern specified below #
# ============================================================================ #
log4j.appender.TheConsole = org.apache.log4j.ConsoleAppender
log4j.appender.TheConsole.layout = org.apache.log4j.PatternLayout
log4j.appender.TheConsole.layout.ConversionPattern = %d{MM-dd HH:mm:ss} %x %-5p %c - %m%n
# ============================================================================ #
# The "AppLogFile" Appender will write the log message to a log file #
# with the pattern and other attributes specified below. #
# ============================================================================ #
log4j.appender.AppLogFile = org.apache.log4j.RollingFileAppender
log4j.appender.AppLogFile.layout = org.apache.log4j.PatternLayout
log4j.appender.AppLogFile.layout.ConversionPattern = %d{MM-dd HH:mm:ss} %x %-5p %c - %m%n
log4j.appender.AppLogFile.MaxBackupIndex = 1
log4j.appender.AppLogFile.MaxFileSize = 10MB
log4j.appender.AppLogFile.Append = false
log4j.appender.AppLogFile.File = SoaSampleServices.log

@ -0,0 +1,136 @@
<project name="SOA Sample Client" default="All" basedir=".">
<description>
Build file to build SOA Tests.
</description>
<echo message=" ===========================================================" />
<echo message=" ================== SOA Hello Teamcenter ===================" />
<echo message=" ===========================================================" />
<!--Javac target version-->
<property name="src" location="${basedir}/src"/>
<property name="soa.home" location="../../.."/>
<fileset dir="${soa.home}/java/libs" id="soa.libs">
<include name="TcSoaCommon_*.jar" />
<include name="TcSoaClient_*.jar" />
<include name="TcSoaStrongModel_*.jar" />
<include name="TcSoaCoreStrong_*.jar" />
<include name="TcSoaCoreTypes_*.jar" />
<include name="TcSoaQueryStrong_*.jar" />
<include name="TcSoaQueryTypes_*.jar" />
<include name="commons-httpclient-3.1.jar" />
</fileset>
<fileset dir="${soa.home}/java/libs" id="third.party.libs">
<include name="log4j.jar" />
<include name="commons-logging.jar" />
<include name="commons-codec.jar" />
<include name="teamcenter_sso_applib.jar"/>
<include name="teamcenter_sso_common.jar"/>
<include name="teamcenter_sso_webtoolkit.jar"/>
<include name="avalon-framework-4.1.5.jar" />
<include name="jacorb.jar" />
<include name="resolver.jar" />
<include name="xercesImpl.jar" />
<include name="xml-apis.jar" />
<include name="logkit-1.2.jar" />
<include name="fscclient.jar"/>
<include name="fccclient.jar"/>
<include name="tcserverjavabinding.jar"/>
<include name="tcmemjavabinding.jar"/>
<include name="tcgatewaystubs.jar"/>
</fileset>
<condition property="is.windows">
<os family="windows"/>
</condition>
<condition property="is.unix">
<os family="unix"/>
</condition>
<path id="build.classpath">
<fileset refid="soa.libs" />
</path>
<path id="run.classpath">
<pathelement location="${basedir}/bin"/>
<fileset refid="soa.libs" />
<fileset refid="third.party.libs" />
</path>
<target name="init">
<tstamp/>
<mkdir dir="${basedir}/bin"/>
</target>
<target name="clean" >
<delete dir="${basedir}/bin" />
</target>
<target name="Compile" depends="init" description="compile the source">
<javac destdir="${basedir}/bin" debug="true" srcdir="${src}">
<classpath refid="build.classpath"/>
</javac>
<copy todir="${basedir}/bin" file="${src}/log4j.properties" />
</target>
<target name="CreateWindowsScript" depends="Compile" if="is.windows">
<property name="app.cp" refid="run.classpath" />
<echo file="RunMe.bat" append="false" >
@echo off
if ""%1""==""-h"" goto Help
if ""%1""==""-help"" goto Help
if ""%1""==""?"" goto Help
SET APP_CP=${app.cp}
"${java.home}\bin\java" -cp %APP_CP% -Dhost=%1% com.teamcenter.hello.Hello
goto Exit
:Help
echo Usage: RunMe [http://server:port/tc]
echo Will default to http://localhost:7001/tc if no argument is given.
:Exit
</echo>
</target>
<target name="CreateUnixScript" depends="Compile" if="is.unix">
<property name="app.cp" refid="run.classpath" />
<echo file="RunMe.sh" append="false" >
if [ "$1" = "-h" ] || [ "$1" = "-help" ] || [ "$1" = "?" ]|| [ $# -ne 1 ]
then
echo "Usage: ./RunMe.sh [http://server:port/tc]"
echo "Will default to http://localhost:7001/tc if no argument is given."
else
export APP_CP=${app.cp}
"${java.home}/bin/java" -cp $APP_CP -Dhost=$1 com.teamcenter.hello.Hello
fi
</echo>
<chmod file="RunMe.sh" perm="ugo+rx"/>
</target>
<target name="All" depends="init,Compile,CreateWindowsScript,CreateUnixScript"/>
</project>

@ -0,0 +1,267 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="EclipseModuleManager">
<libelement value="jar://$MODULE_DIR$/lib/commons-codec.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/commons-httpclient-3.1.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/fccclient.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/fscclient.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/log4j-1.2.13.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/resolver.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/tcmemjavabinding.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/tcserverjavabinding.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/TcSoaClient_11000.2.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/TcSoaCommon_11000.2.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/TcSoaCoreStrong_11000.2.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/TcSoaQueryStrong_11000.2.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/xml-apis.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/TcSoaStrongModel_11000.2.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/xercesImpl.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/commons-logging-1.1.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/commons-net-3.6.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/dom4j-1.6.1.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/iText-5.0.2.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/TcSoaAdministrationStrong_11000.2.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/TcSoaAdministrationTypes_11000.2.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/org.apache.commons.lang_2.3.0.v200803061910.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/TcSoaCoreTypes_11000.2.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/TcSoaWorkflowStrong_11000.2.0.jar!/" />
<libelement value="jar://$MODULE_DIR$/lib/TcSoaWorkflowTypes_11000.2.0.jar!/" />
<src_description expected_position="0">
<src_folder value="file://$MODULE_DIR$/src" expected_position="0" />
</src_description>
</component>
<component name="NewModuleRootManager">
<output url="file://$MODULE_DIR$/bin" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="jdk" jdkName="JavaSE-1.7" jdkType="JavaSDK" />
<orderEntry type="module-library">
<library name="commons-codec.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-codec.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="commons-httpclient-3.1.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-httpclient-3.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="fccclient.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/fccclient.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="fscclient.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/fscclient.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="log4j-1.2.13.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/log4j-1.2.13.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="resolver.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/resolver.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="tcmemjavabinding.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/tcmemjavabinding.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="tcserverjavabinding.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/tcserverjavabinding.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="TcSoaClient_11000.2.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/TcSoaClient_11000.2.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="TcSoaCommon_11000.2.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/TcSoaCommon_11000.2.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="TcSoaCoreStrong_11000.2.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/TcSoaCoreStrong_11000.2.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="TcSoaQueryStrong_11000.2.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/TcSoaQueryStrong_11000.2.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="xml-apis.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/xml-apis.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="TcSoaStrongModel_11000.2.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/TcSoaStrongModel_11000.2.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="xercesImpl.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/xercesImpl.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="commons-logging-1.1.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-logging-1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="commons-net-3.6.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-net-3.6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="dom4j-1.6.1.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/dom4j-1.6.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="iText-5.0.2.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/iText-5.0.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="TcSoaAdministrationStrong_11000.2.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/TcSoaAdministrationStrong_11000.2.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="TcSoaAdministrationTypes_11000.2.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/TcSoaAdministrationTypes_11000.2.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="org.apache.commons.lang_2.3.0.v200803061910.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/org.apache.commons.lang_2.3.0.v200803061910.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="TcSoaCoreTypes_11000.2.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/TcSoaCoreTypes_11000.2.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="TcSoaWorkflowStrong_11000.2.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/TcSoaWorkflowStrong_11000.2.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="TcSoaWorkflowTypes_11000.2.0.jar">
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/TcSoaWorkflowTypes_11000.2.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
</module>

@ -0,0 +1,334 @@
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006022df5b, pid=5892, tid=8992
#
# JRE version: 7.0_21-b11
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.21-b01 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# V [jvm.dll+0x11df5b]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
#
--------------- T H R E A D ---------------
Current thread (0x000000000c5aa000): JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_vm, id=8992, stack(0x000000000db30000,0x000000000dc30000)]
siginfo: ExceptionCode=0xc0000005, reading address 0xffffffffffffffff
Registers:
RAX=0x000000000dc2f201, RBX=0x000000000c5aa000, RCX=0x72412f6c00000000, RDX=0x000000000c5aa000
RSP=0x000000000dc2f240, RBP=0x72412f6c00000000, RSI=0x000000000dc2f358, RDI=0x0000000001829f30
R8 =0x000000000dc2f358, R9 =0x0000000000000001, R10=0x0000000000008000, R11=0x000000000dc2f190
R12=0x0000000000000000, R13=0x0000000000000000, R14=0x0000000000000000, R15=0x0000000000000000
RIP=0x000000006022df5b, EFLAGS=0x0000000000010206
Top of Stack: (sp=0x000000000dc2f240)
0x000000000dc2f240: 000000000c5aa000 000000000c5a2520
0x000000000dc2f250: 000000000dc2f308 00000000603b5699
0x000000000dc2f260: 000000000c5aa000 00000000603d1062
0x000000000dc2f270: 0000000000000000 000000000c5aa000
0x000000000dc2f280: 000000000c5abbd8 0000000060a2264e
0x000000000dc2f290: 000000000c5aa000 0000000000000000
0x000000000dc2f2a0: 0000000000000000 0000000000000000
0x000000000dc2f2b0: 72412f6c00000000 0000000060a21745
0x000000000dc2f2c0: 000000000dc2f358 000000000dc2f330
0x000000000dc2f2d0: 0000000000000001 000000000c5abbd8
0x000000000dc2f2e0: 72412f6c00000000 0000000060a053b3
0x000000000dc2f2f0: 000000000dc2f420 0000000000000001
0x000000000dc2f300: 0000000000000001 000000000c5abbd8
0x000000000dc2f310: 0000000000000009 0000000000000000
0x000000000dc2f320: 0000000000000000 0000000000000000
0x000000000dc2f330: 0000000000000001 0000000060a05571
Instructions: (pc=0x000000006022df5b)
0x000000006022df3b: 48 8b 5c 24 30 48 89 47 18 48 83 c4 20 5f c3 cc
0x000000006022df4b: cc cc cc cc cc 40 53 48 83 ec 20 48 85 c9 74 54
0x000000006022df5b: 48 8b 19 48 85 db 74 4c 48 b8 fe fe fe fe fe fe
0x000000006022df6b: fe fe 48 3b d8 74 3d 80 3d ff fd 58 00 00 74 15
Register to memory mapping:
RAX=0x000000000dc2f201 is pointing into the stack for thread: 0x000000000c5aa000
RBX=0x000000000c5aa000 is a thread
RCX=0x72412f6c00000000 is an unknown value
RDX=0x000000000c5aa000 is a thread
RSP=0x000000000dc2f240 is pointing into the stack for thread: 0x000000000c5aa000
RBP=0x72412f6c00000000 is an unknown value
RSI=0x000000000dc2f358 is pointing into the stack for thread: 0x000000000c5aa000
RDI=0x0000000001829f30 is an unknown value
R8 =0x000000000dc2f358 is pointing into the stack for thread: 0x000000000c5aa000
R9 =0x0000000000000001 is an unknown value
R10=0x0000000000008000 is an unknown value
R11=0x000000000dc2f190 is pointing into the stack for thread: 0x000000000c5aa000
R12=0x0000000000000000 is an unknown value
R13=0x0000000000000000 is an unknown value
R14=0x0000000000000000 is an unknown value
R15=0x0000000000000000 is an unknown value
Stack: [0x000000000db30000,0x000000000dc30000], sp=0x000000000dc2f240, free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V [jvm.dll+0x11df5b]
[error occurred during error reporting (printing native stack), id 0xc0000005]
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x000000000ef6e800 JavaThread "MultiThreadedHttpConnectionManager cleanup" daemon [_thread_blocked, id=8416, stack(0x000000000ff00000,0x0000000010000000)]
0x000000000ef6d800 JavaThread "MultiThreadedHttpConnectionManager cleanup" daemon [_thread_blocked, id=11000, stack(0x000000000fe00000,0x000000000ff00000)]
0x000000000df61800 JavaThread "Service Thread" daemon [_thread_blocked, id=4068, stack(0x000000000e430000,0x000000000e530000)]
0x000000000df5f000 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=8200, stack(0x000000000e330000,0x000000000e430000)]
0x000000000df5e800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=12156, stack(0x000000000e230000,0x000000000e330000)]
0x000000000c5ba800 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=10624, stack(0x000000000dd30000,0x000000000de30000)]
0x000000000c5b9000 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=5212, stack(0x000000000dc30000,0x000000000dd30000)]
=>0x000000000c5aa000 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_vm, id=8992, stack(0x000000000db30000,0x000000000dc30000)]
0x000000000c5a3000 JavaThread "Attach Listener" daemon [_thread_blocked, id=8208, stack(0x000000000da30000,0x000000000db30000)]
0x000000000c5a0000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=11148, stack(0x000000000d930000,0x000000000da30000)]
0x000000000c519000 JavaThread "Finalizer" daemon [_thread_blocked, id=6264, stack(0x000000000d830000,0x000000000d930000)]
0x000000000c510000 JavaThread "Reference Handler" daemon [_thread_blocked, id=1004, stack(0x000000000d730000,0x000000000d830000)]
0x000000000182e000 JavaThread "main" [_thread_blocked, id=8160, stack(0x0000000003360000,0x0000000003460000)]
Other Threads:
0x000000000c507800 VMThread [stack: 0x000000000d630000,0x000000000d730000] [id=6952]
0x000000000dfa7000 WatcherThread [stack: 0x000000000e530000,0x000000000e630000] [id=13228]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap
PSYoungGen total 134912K, used 134891K [0x00000007d5d60000, 0x00000007de660000, 0x0000000800000000)
eden space 129536K, 100% used [0x00000007d5d60000,0x00000007ddbe0000,0x00000007ddbe0000)
from space 5376K, 99% used [0x00000007de120000,0x00000007de65ae50,0x00000007de660000)
to space 5376K, 0% used [0x00000007ddbe0000,0x00000007ddbe0000,0x00000007de120000)
ParOldGen total 86400K, used 11627K [0x0000000781800000, 0x0000000786c60000, 0x00000007d5d60000)
object space 86400K, 13% used [0x0000000781800000,0x000000078235ad20,0x0000000786c60000)
PSPermGen total 27776K, used 27663K [0x000000077c600000, 0x000000077e120000, 0x0000000781800000)
object space 27776K, 99% used [0x000000077c600000,0x000000077e103e48,0x000000077e120000)
Card table byte_map: [0x0000000006720000,0x0000000006b40000] byte_map_base: 0x0000000002b3d000
Polling page: 0x0000000001320000
Code Cache [0x0000000003660000, 0x0000000003910000, 0x0000000006660000)
total_blobs=910 nmethods=593 adapters=275 free_code_cache=46458Kb largest_free_block=47531840
Compilation events (10 events):
Event: 28.155 Thread 0x000000000df5e800 611 java.lang.String::trim (77 bytes)
Event: 28.157 Thread 0x000000000df5e800 nmethod 611 0x00000000038f5cd0 code [0x00000000038f5e20, 0x00000000038f5fa8]
Event: 28.462 Thread 0x000000000df5f000 612 org.apache.xerces.impl.XMLScanner::normalizeWhitespace (56 bytes)
Event: 28.464 Thread 0x000000000df5e800 613 java.lang.Integer::<init> (10 bytes)
Event: 28.465 Thread 0x000000000df5e800 nmethod 613 0x00000000038f5ad0 code [0x00000000038f5c00, 0x00000000038f5c58]
Event: 28.465 Thread 0x000000000df5f000 nmethod 612 0x00000000038f5650 code [0x00000000038f57a0, 0x00000000038f59b8]
Event: 48.192 Thread 0x000000000df5e800 614 sun.util.calendar.ZoneInfo::getTransitionIndex (156 bytes)
Event: 48.198 Thread 0x000000000df5f000 615 java.util.regex.Matcher::reset (83 bytes)
Event: 48.200 Thread 0x000000000df5e800 nmethod 614 0x00000000038fba90 code [0x00000000038fbbe0, 0x00000000038fc158]
Event: 48.201 Thread 0x000000000df5f000 nmethod 615 0x00000000038f51d0 code [0x00000000038f5320, 0x00000000038f54e8]
GC Heap History (8 events):
Event: 1.727 GC heap before
{Heap before GC invocations=1 (full 0):
PSYoungGen total 37760K, used 32384K [0x00000007d5d60000, 0x00000007d8780000, 0x0000000800000000)
eden space 32384K, 100% used [0x00000007d5d60000,0x00000007d7d00000,0x00000007d7d00000)
from space 5376K, 0% used [0x00000007d8240000,0x00000007d8240000,0x00000007d8780000)
to space 5376K, 0% used [0x00000007d7d00000,0x00000007d7d00000,0x00000007d8240000)
ParOldGen total 86400K, used 0K [0x0000000781800000, 0x0000000786c60000, 0x00000007d5d60000)
object space 86400K, 0% used [0x0000000781800000,0x0000000781800000,0x0000000786c60000)
PSPermGen total 21248K, used 9474K [0x000000077c600000, 0x000000077dac0000, 0x0000000781800000)
object space 21248K, 44% used [0x000000077c600000,0x000000077cf40818,0x000000077dac0000)
Event: 1.755 GC heap after
Heap after GC invocations=1 (full 0):
PSYoungGen total 37760K, used 3371K [0x00000007d5d60000, 0x00000007da720000, 0x0000000800000000)
eden space 32384K, 0% used [0x00000007d5d60000,0x00000007d5d60000,0x00000007d7d00000)
from space 5376K, 62% used [0x00000007d7d00000,0x00000007d804ae10,0x00000007d8240000)
to space 5376K, 0% used [0x00000007da1e0000,0x00000007da1e0000,0x00000007da720000)
ParOldGen total 86400K, used 8K [0x0000000781800000, 0x0000000786c60000, 0x00000007d5d60000)
object space 86400K, 0% used [0x0000000781800000,0x0000000781802000,0x0000000786c60000)
PSPermGen total 21248K, used 9474K [0x000000077c600000, 0x000000077dac0000, 0x0000000781800000)
object space 21248K, 44% used [0x000000077c600000,0x000000077cf40818,0x000000077dac0000)
}
Event: 2.566 GC heap before
{Heap before GC invocations=2 (full 0):
PSYoungGen total 37760K, used 35755K [0x00000007d5d60000, 0x00000007da720000, 0x0000000800000000)
eden space 32384K, 100% used [0x00000007d5d60000,0x00000007d7d00000,0x00000007d7d00000)
from space 5376K, 62% used [0x00000007d7d00000,0x00000007d804ae10,0x00000007d8240000)
to space 5376K, 0% used [0x00000007da1e0000,0x00000007da1e0000,0x00000007da720000)
ParOldGen total 86400K, used 8K [0x0000000781800000, 0x0000000786c60000, 0x00000007d5d60000)
object space 86400K, 0% used [0x0000000781800000,0x0000000781802000,0x0000000786c60000)
PSPermGen total 21248K, used 13155K [0x000000077c600000, 0x000000077dac0000, 0x0000000781800000)
object space 21248K, 61% used [0x000000077c600000,0x000000077d2d8c68,0x000000077dac0000)
Event: 2.581 GC heap after
Heap after GC invocations=2 (full 0):
PSYoungGen total 70144K, used 4171K [0x00000007d5d60000, 0x00000007da720000, 0x0000000800000000)
eden space 64768K, 0% used [0x00000007d5d60000,0x00000007d5d60000,0x00000007d9ca0000)
from space 5376K, 77% used [0x00000007da1e0000,0x00000007da5f2e60,0x00000007da720000)
to space 5376K, 0% used [0x00000007d9ca0000,0x00000007d9ca0000,0x00000007da1e0000)
ParOldGen total 86400K, used 16K [0x0000000781800000, 0x0000000786c60000, 0x00000007d5d60000)
object space 86400K, 0% used [0x0000000781800000,0x0000000781804000,0x0000000786c60000)
PSPermGen total 21248K, used 13155K [0x000000077c600000, 0x000000077dac0000, 0x0000000781800000)
object space 21248K, 61% used [0x000000077c600000,0x000000077d2d8c68,0x000000077dac0000)
}
Event: 4.278 GC heap before
{Heap before GC invocations=3 (full 0):
PSYoungGen total 70144K, used 68939K [0x00000007d5d60000, 0x00000007da720000, 0x0000000800000000)
eden space 64768K, 100% used [0x00000007d5d60000,0x00000007d9ca0000,0x00000007d9ca0000)
from space 5376K, 77% used [0x00000007da1e0000,0x00000007da5f2e60,0x00000007da720000)
to space 5376K, 0% used [0x00000007d9ca0000,0x00000007d9ca0000,0x00000007da1e0000)
ParOldGen total 86400K, used 16K [0x0000000781800000, 0x0000000786c60000, 0x00000007d5d60000)
object space 86400K, 0% used [0x0000000781800000,0x0000000781804000,0x0000000786c60000)
PSPermGen total 21248K, used 20830K [0x000000077c600000, 0x000000077dac0000, 0x0000000781800000)
object space 21248K, 98% used [0x000000077c600000,0x000000077da57be8,0x000000077dac0000)
Event: 4.294 GC heap after
Heap after GC invocations=3 (full 0):
PSYoungGen total 70144K, used 5355K [0x00000007d5d60000, 0x00000007de660000, 0x0000000800000000)
eden space 64768K, 0% used [0x00000007d5d60000,0x00000007d5d60000,0x00000007d9ca0000)
from space 5376K, 99% used [0x00000007d9ca0000,0x00000007da1dae80,0x00000007da1e0000)
to space 5376K, 0% used [0x00000007de120000,0x00000007de120000,0x00000007de660000)
ParOldGen total 86400K, used 3393K [0x0000000781800000, 0x0000000786c60000, 0x00000007d5d60000)
object space 86400K, 3% used [0x0000000781800000,0x0000000781b506a8,0x0000000786c60000)
PSPermGen total 21248K, used 20830K [0x000000077c600000, 0x000000077dac0000, 0x0000000781800000)
object space 21248K, 98% used [0x000000077c600000,0x000000077da57be8,0x000000077dac0000)
}
Event: 6.591 GC heap before
{Heap before GC invocations=4 (full 0):
PSYoungGen total 70144K, used 70123K [0x00000007d5d60000, 0x00000007de660000, 0x0000000800000000)
eden space 64768K, 100% used [0x00000007d5d60000,0x00000007d9ca0000,0x00000007d9ca0000)
from space 5376K, 99% used [0x00000007d9ca0000,0x00000007da1dae80,0x00000007da1e0000)
to space 5376K, 0% used [0x00000007de120000,0x00000007de120000,0x00000007de660000)
ParOldGen total 86400K, used 3393K [0x0000000781800000, 0x0000000786c60000, 0x00000007d5d60000)
object space 86400K, 3% used [0x0000000781800000,0x0000000781b506a8,0x0000000786c60000)
PSPermGen total 24128K, used 24047K [0x000000077c600000, 0x000000077dd90000, 0x0000000781800000)
object space 24128K, 99% used [0x000000077c600000,0x000000077dd7bf20,0x000000077dd90000)
Event: 6.610 GC heap after
Heap after GC invocations=4 (full 0):
PSYoungGen total 134912K, used 5355K [0x00000007d5d60000, 0x00000007de660000, 0x0000000800000000)
eden space 129536K, 0% used [0x00000007d5d60000,0x00000007d5d60000,0x00000007ddbe0000)
from space 5376K, 99% used [0x00000007de120000,0x00000007de65ae50,0x00000007de660000)
to space 5376K, 0% used [0x00000007ddbe0000,0x00000007ddbe0000,0x00000007de120000)
ParOldGen total 86400K, used 11627K [0x0000000781800000, 0x0000000786c60000, 0x00000007d5d60000)
object space 86400K, 13% used [0x0000000781800000,0x000000078235ad20,0x0000000786c60000)
PSPermGen total 24128K, used 24047K [0x000000077c600000, 0x000000077dd90000, 0x0000000781800000)
object space 24128K, 99% used [0x000000077c600000,0x000000077dd7bf20,0x000000077dd90000)
}
Deoptimization events (10 events):
Event: 14.481 Thread 0x000000000182e000 Uncommon trap -83 fr.pc 0x0000000003791218
Event: 14.495 Thread 0x000000000182e000 Uncommon trap -34 fr.pc 0x00000000037e9c30
Event: 14.499 Thread 0x000000000182e000 Uncommon trap -83 fr.pc 0x00000000038a42a4
Event: 14.666 Thread 0x000000000182e000 Uncommon trap -75 fr.pc 0x00000000038befdc
Event: 19.355 Thread 0x000000000182e000 Uncommon trap -42 fr.pc 0x00000000037bb4dc
Event: 19.355 Thread 0x000000000182e000 Uncommon trap -42 fr.pc 0x00000000037bb4dc
Event: 19.356 Thread 0x000000000182e000 Uncommon trap -42 fr.pc 0x00000000037bb4dc
Event: 19.356 Thread 0x000000000182e000 Uncommon trap -42 fr.pc 0x00000000037bb4dc
Event: 24.077 Thread 0x000000000182e000 Uncommon trap -12 fr.pc 0x00000000038de438
Event: 48.123 Thread 0x000000000182e000 Uncommon trap -83 fr.pc 0x00000000038e3238
Internal exceptions (10 events):
Event: 48.099 Thread 0x000000000182e000 Threw 0x00000007dd932d18 at C:\jdk7u2_64p\jdk7u21\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 48.099 Thread 0x000000000182e000 Threw 0x00000007dd9393b0 at C:\jdk7u2_64p\jdk7u21\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 48.102 Thread 0x000000000182e000 Threw 0x00000007dd9556f0 at C:\jdk7u2_64p\jdk7u21\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 48.120 Thread 0x000000000182e000 Threw 0x00000007dd973960 at C:\jdk7u2_64p\jdk7u21\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 48.121 Thread 0x000000000182e000 Threw 0x00000007dd987d68 at C:\jdk7u2_64p\jdk7u21\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 48.172 Thread 0x000000000182e000 Threw 0x00000007dd9a4d68 at C:\jdk7u2_64p\jdk7u21\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 48.174 Thread 0x000000000182e000 Threw 0x00000007dd9abd70 at C:\jdk7u2_64p\jdk7u21\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 48.174 Thread 0x000000000182e000 Threw 0x00000007dd9b1128 at C:\jdk7u2_64p\jdk7u21\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 48.175 Thread 0x000000000182e000 Threw 0x00000007dd9b7d08 at C:\jdk7u2_64p\jdk7u21\hotspot\src\share\vm\prims\jvm.cpp:1166
Event: 48.176 Thread 0x000000000182e000 Threw 0x00000007dd9bea38 at C:\jdk7u2_64p\jdk7u21\hotspot\src\share\vm\prims\jvm.cpp:1166
Events (10 events):
Event: 105.125 Executing VM operation: GetCurrentLocation
Event: 105.125 Executing VM operation: GetCurrentLocation done
Event: 105.125 Executing VM operation: EnterInterpOnlyMode
Event: 105.125 Executing VM operation: EnterInterpOnlyMode done
Event: 105.125 Executing VM operation: ChangeSingleStep
Event: 105.125 Executing VM operation: ChangeSingleStep done
Event: 105.125 Executing VM operation: ChangeSingleStep
Event: 105.125 Executing VM operation: ChangeSingleStep done
Event: 105.150 Executing VM operation: RedefineClasses
Event: 105.157 Executing VM operation: RedefineClasses done
Dynamic libraries:
0x00007ff622130000 - 0x00007ff622163000 D:\TC\Java\jdk1.7.0_21\bin\javaw.exe
0x00007ffb537f0000 - 0x00007ffb539e8000 C:\WINDOWS\SYSTEM32\ntdll.dll
0x00007ffb51e70000 - 0x00007ffb51f2f000 C:\WINDOWS\System32\KERNEL32.DLL
0x00007ffb51450000 - 0x00007ffb51746000 C:\WINDOWS\System32\KERNELBASE.dll
0x00007ffb51980000 - 0x00007ffb51a2f000 C:\WINDOWS\System32\ADVAPI32.dll
0x00007ffb53710000 - 0x00007ffb537ae000 C:\WINDOWS\System32\msvcrt.dll
0x00007ffb52920000 - 0x00007ffb529bc000 C:\WINDOWS\System32\sechost.dll
0x00007ffb51850000 - 0x00007ffb51976000 C:\WINDOWS\System32\RPCRT4.dll
0x00007ffb52000000 - 0x00007ffb5219d000 C:\WINDOWS\System32\USER32.dll
0x00007ffb50ed0000 - 0x00007ffb50ef2000 C:\WINDOWS\System32\win32u.dll
0x00007ffb51e20000 - 0x00007ffb51e4c000 C:\WINDOWS\System32\GDI32.dll
0x00007ffb510e0000 - 0x00007ffb511f5000 C:\WINDOWS\System32\gdi32full.dll
0x00007ffb513b0000 - 0x00007ffb5144d000 C:\WINDOWS\System32\msvcp_win.dll
0x00007ffb51200000 - 0x00007ffb51300000 C:\WINDOWS\System32\ucrtbase.dll
0x00007ffb3f670000 - 0x00007ffb3f90a000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e\COMCTL32.dll
0x00007ffb52810000 - 0x00007ffb52840000 C:\WINDOWS\System32\IMM32.DLL
0x0000000060d20000 - 0x0000000060df1000 D:\TC\Java\jdk1.7.0_21\jre\bin\msvcr100.dll
0x0000000060110000 - 0x0000000060831000 D:\TC\Java\jdk1.7.0_21\jre\bin\server\jvm.dll
0x00007ffb52910000 - 0x00007ffb52918000 C:\WINDOWS\System32\PSAPI.DLL
0x00007ffb3f320000 - 0x00007ffb3f347000 C:\WINDOWS\SYSTEM32\WINMM.dll
0x00007ffb370c0000 - 0x00007ffb370c9000 C:\WINDOWS\SYSTEM32\WSOCK32.dll
0x00007ffb52840000 - 0x00007ffb528ab000 C:\WINDOWS\System32\WS2_32.dll
0x0000000060a70000 - 0x0000000060a7f000 D:\TC\Java\jdk1.7.0_21\jre\bin\verify.dll
0x0000000060a40000 - 0x0000000060a68000 D:\TC\Java\jdk1.7.0_21\jre\bin\java.dll
0x0000000060a00000 - 0x0000000060a35000 D:\TC\Java\jdk1.7.0_21\jre\bin\jdwp.dll
0x00000000609f0000 - 0x00000000609f8000 D:\TC\Java\jdk1.7.0_21\jre\bin\npt.dll
0x0000000059650000 - 0x0000000059673000 D:\TC\Java\jdk1.7.0_21\jre\bin\instrument.dll
0x00000000609d0000 - 0x00000000609e5000 D:\TC\Java\jdk1.7.0_21\jre\bin\zip.dll
0x00000000609c0000 - 0x00000000609c9000 D:\TC\Java\jdk1.7.0_21\jre\bin\dt_socket.dll
0x00007ffb38db0000 - 0x00007ffb38dc7000 C:\WINDOWS\system32\napinsp.dll
0x00007ffb38d90000 - 0x00007ffb38dab000 C:\WINDOWS\system32\pnrpnsp.dll
0x00007ffb38d70000 - 0x00007ffb38d85000 C:\WINDOWS\system32\wshbth.dll
0x00007ffb49b10000 - 0x00007ffb49b2d000 C:\WINDOWS\system32\NLAapi.dll
0x00007ffb50300000 - 0x00007ffb5033c000 C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL
0x00007ffb50680000 - 0x00007ffb506ea000 C:\WINDOWS\System32\mswsock.dll
0x00007ffb50340000 - 0x00007ffb5040a000 C:\WINDOWS\SYSTEM32\DNSAPI.dll
0x00007ffb529c0000 - 0x00007ffb529c8000 C:\WINDOWS\System32\NSI.dll
0x00007ffb38d50000 - 0x00007ffb38d62000 C:\WINDOWS\System32\winrnr.dll
0x00007ffb418d0000 - 0x00007ffb41952000 C:\WINDOWS\System32\fwpuclnt.dll
0x00007ffb51060000 - 0x00007ffb51087000 C:\WINDOWS\System32\bcrypt.dll
0x00007ffb41820000 - 0x00007ffb4182a000 C:\Windows\System32\rasadhlp.dll
0x00000000609a0000 - 0x00000000609b9000 D:\TC\Java\jdk1.7.0_21\jre\bin\net.dll
0x000000005ffe0000 - 0x000000005fff1000 D:\TC\Java\jdk1.7.0_21\jre\bin\nio.dll
0x0000000060990000 - 0x000000006099b000 D:\TC\Java\jdk1.7.0_21\jre\bin\management.dll
0x00007ffb4ffe0000 - 0x00007ffb50013000 C:\WINDOWS\SYSTEM32\ntmarta.dll
0x00007ffb473e0000 - 0x00007ffb475c4000 C:\WINDOWS\SYSTEM32\dbghelp.dll
0x00007ffb517c0000 - 0x00007ffb51842000 C:\WINDOWS\System32\bcryptPrimitives.dll
VM Arguments:
jvm_args: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:15832 -javaagent:D:\eclipse\configuration\org.eclipse.osgi\424\0\.cp\lib\javaagent-shaded.jar -Dfile.encoding=GBK
java_command: com.teamcenter.hello.caxaPropertyHandler
Launcher Type: SUN_STANDARD
Environment Variables:
CLASSPATH=.;\lib\dt.jar;\lib\tools.jar
PATH=D:\TC\Java\jdk1.7.0_21\jre\bin;D:/eclipse//plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.6.v20230204-1729/jre/bin/server;D:/eclipse//plugins/org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.6.v20230204-1729/jre/bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;"D:\TC \Java\jdk1.7.0_21\bin;D:\TC\Java\jre7\bin";C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;D:\software\VisualSVN\bin;D:\TortoiseSVN\bin;C:\Users\HX\AppData\Local\Microsoft\WindowsApps;C:\WINDOWS\system32;
USERNAME=HX
OS=Windows_NT
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 142 Stepping 9, GenuineIntel
--------------- S Y S T E M ---------------
OS: Windows 8 , 64 bit Build 9200
CPU:total 4 (2 cores per cpu, 2 threads per core) family 6 model 142 stepping 9, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, ht, tsc, tscinvbit
Memory: 4k page, physical 8289204k(1915604k free), swap 14646164k(1577180k free)
vm_info: Java HotSpot(TM) 64-Bit Server VM (23.21-b01) for windows-amd64 JRE (1.7.0_21-b11), built on Apr 4 2013 08:11:28 by "java_re" with unknown MS VC++:1600
time: Tue Jul 11 17:09:03 2023
elapsed time: 105 seconds

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,4 @@
<!--公司名称 HX为宏协 HXC为宏协承-->
CompanyName=HX
<!--等待pdf超时的时间设置单位半秒建议宏协设置为30 宏协承设置为100-->
WAITPDF=100

@ -0,0 +1,164 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--格式说明
<Files>——要签名的文件名列表可以有多个每个可以是EXB或DWG可以有不同的标题栏识别方式
<File Path="C:\FolderA\FileA.exb" Method="Object" SaveVersion="2013" />
——Path: EXB或DWG文件绝对路径
——Method: 标题栏搜索方式, 可选ObjectBlock, Auto
——Object: 查找NEB标题栏对象仅适用于EXB文件效率最高
——Block: 标题栏块名可用于EXBDWG文件
——Auto自动判断如果是DWG文件需要提供标题栏块名
——BlockName: 标题栏块名当Method为Block, Auto时需要
——TemplatePath:块模板当Method为Block, Auto时需要当有BlockName是优先使用BlockName
——SaveVersion: 签名后,保存的文件版本,默认是原始文件对应的版本
</Files>
<Title> ——要签名的标题栏信息
<Attribute Type="String" Name="单位名称" Value="CAXA"/>
——Type: 签名属性类型,可选 String 和 ImageString指签名字符串内容Image指签名图片绝对路径
——Name: 属性名称
——Value: 属性质当Type为Image时它是图片绝对路径
</Title>
--><PDMIntegration>
<SignInfo>
<Files>
<!-->
<File Path="C:\Program Files (x86)\Common Files\CAXA Shared\CAXA Common Component\CAXADraftInfo\Shell\Samples\sign\CAXA-TITLE.exb"
Method="Object"
SaveVersion="2011" />
<File Path="C:\Program Files (x86)\Common Files\CAXA Shared\CAXA Common Component\CAXADraftInfo\Shell\Samples\sign\mytitle.dwg"
Method="Block"
BlockName="mytitle"
TemplatePath="C:\Program Files (x86)\Common Files\CAXA Shared\CAXA Common Component\CAXADraftInfo\Shell\Samples\sign\CxBlockTemplate.xml"
SaveVersion="2010" />
<File Path="C:\Program Files (x86)\Common Files\CAXA Shared\CAXA Common Component\CAXADraftInfo\Shell\Samples\sign\CAXA-TITLE.dwg"
Method="Auto"
SaveVersion="2010" />
<!-->
<File Path="D:\\CAXAPLM\QT23007209901-B0120230720093857261.exb" Method="Auto"/>
</Files>
<Title>
<Attribute Type="String" Name="是否更新签字" Value="是"/>
<Attribute Type="String" Name="产品名称" Value="QT23007前车门后托架铝型材"/>
<Attribute Type="String" Name="产品型号" Value="QT23007209901"/>
<Attribute Type="String" Name="更改版次1" Value="B01"/>
<Attribute Type="String" Name="设计人员" Value=""/>
<Attribute Type="String" Name="设计日期" Value=""/>
<Attribute Type="String" Name="设计日期1" Value=""/>
<Attribute Type="String" Name="审核人员" Value=""/>
<Attribute Type="String" Name="审核日期" Value=""/>
<Attribute Type="String" Name="工艺人员" Value=""/>
<Attribute Type="String" Name="材料名称" Value=""/>
<Attribute Type="String" Name="材料厚度" Value=""/>
<Attribute Type="String" Name="样件标记" Value=""/>
<Attribute Type="String" Name="试生产标记" Value=""/>
<Attribute Type="String" Name="生产标记" Value=""/>
<Attribute Type="String" Name="工艺审核日期" Value=""/>
<Attribute Type="String" Name="标准化人员" Value=""/>
<Attribute Type="String" Name="标准化审核日期" Value=""/>
<Attribute Type="String" Name="批准人员" Value=""/>
<Attribute Type="String" Name="批准日期" Value=""/>
<Attribute Type="String" Name="重量" Value=""/>
<Attribute Type="String" Name="创建日期" Value=""/>
<Attribute Type="String" Name="更改类别" Value=""/>
<Attribute Type="String" Name="零部件图号" Value=""/>
<Attribute Type="String" Name="零部件名称" Value=""/>
<Attribute Type="String" Name="计划部人员" Value=""/>
<Attribute Type="String" Name="计划部日期" Value=""/>
<Attribute Type="String" Name="制造部人员" Value=""/>
<Attribute Type="String" Name="制造部日期" Value=""/>
<Attribute Type="String" Name="品质部人员" Value=""/>
<Attribute Type="String" Name="品质部日期" Value=""/>
<Attribute Type="String" Name="编号" Value=""/>
<Attribute Type="String" Name="编制人员" Value=""/>
<Attribute Type="String" Name="编制日期" Value=""/>
<Attribute Type="String" Name="审核人员" Value=""/>
<Attribute Type="String" Name="审核日期" Value=""/>
<Attribute Type="String" Name="批准人员1" Value=""/>
<Attribute Type="String" Name="批准日期1" Value=""/>
<Attribute Type="String" Name="批准人员2" Value=""/>
<Attribute Type="String" Name="批准日期2" Value=""/>
<Attribute Type="String" Name="更改原因" Value=""/>
<Attribute Type="String" Name="图纸" Value=""/>
<Attribute Type="String" Name="图纸说明" Value=""/>
<Attribute Type="String" Name="发客户图纸" Value=""/>
<Attribute Type="String" Name="同系列产品" Value=""/>
<Attribute Type="String" Name="工艺" Value=""/>
<Attribute Type="String" Name="激光打印" Value=""/>
<Attribute Type="String" Name="外协加工图" Value=""/>
<Attribute Type="String" Name="MES数据库" Value=""/>
<Attribute Type="String" Name="作业指导书" Value=""/>
<Attribute Type="String" Name="模具" Value=""/>
<Attribute Type="String" Name="条码系统" Value=""/>
<Attribute Type="String" Name="DFMEA" Value=""/>
<Attribute Type="String" Name="PFMEA" Value=""/>
<Attribute Type="String" Name="控制计划" Value=""/>
<Attribute Type="String" Name="技术部ERP" Value=""/>
<Attribute Type="String" Name="计划部ERP" Value=""/>
<Attribute Type="String" Name="品质检具或封样" Value=""/>
<Attribute Type="String" Name="设备参数调整" Value=""/>
<Attribute Type="String" Name="品质称重防错维护" Value=""/>
<Attribute Type="String" Name="品质检查基准书" Value=""/>
<Attribute Type="String" Name="包装" Value=""/>
<Attribute Type="String" Name="工艺图编号" Value="QT23007209901"/>
<Attribute Type="String" Name="工序名称" Value="QT23007前车门后托架铝型材"/>
<Attribute Type="String" Name="技术编制人员" Value=""/>
<Attribute Type="String" Name="技术编制日期" Value=""/>
<Attribute Type="String" Name="技术审核人员" Value=""/>
<Attribute Type="String" Name="技术审核日期" Value=""/>
<Attribute Type="String" Name="品质编制人员" Value=""/>
<Attribute Type="String" Name="品质编制日期" Value=""/>
<Attribute Type="String" Name="品质审核人员" Value=""/>
<Attribute Type="String" Name="品质审核日期" Value=""/>
<Attribute Type="String" Name="品质批准人员" Value=""/>
<Attribute Type="String" Name="品质批准日期" Value=""/>
<Attribute Type="String" Name="技术批准人员" Value=""/>
<Attribute Type="String" Name="技术批准日期" Value=""/>
<Attribute Type="String" Name="更改文件名1" Value=""/>
<Attribute Type="String" Name="日期1" Value=""/>
<Attribute Type="String" Name="签字1" Value=""/>
<Attribute Type="String" Name="更改版次" Value="B04"/>
<Attribute Type="String" Name="更改文件号" Value=""/>
<Attribute Type="String" Name="日期" Value="2023.07.19"/>
<Attribute Type="String" Name="签字" Value=""/>
<Attribute Type="String" Name="模具1" Value=""/>
<Attribute Type="String" Name="模具2" Value=""/>
<Attribute Type="String" Name="模具3" Value=""/>
<Attribute Type="String" Name="模具4" Value=""/>
<Attribute Type="String" Name="模具5" Value=""/>
<Attribute Type="String" Name="模具6" Value=""/>
<Attribute Type="String" Name="模具7" Value=""/>
<Attribute Type="String" Name="模具8" Value=""/>
<Attribute Type="String" Name="检具1" Value=""/>
<Attribute Type="String" Name="检具2" Value=""/>
<Attribute Type="String" Name="检具3" Value=""/>
<Attribute Type="String" Name="检具4" Value=""/>
<Attribute Type="String" Name="检具5" Value=""/>
<Attribute Type="String" Name="检具6" Value=""/>
<Attribute Type="String" Name="检具7" Value=""/>
<Attribute Type="String" Name="检具8" Value=""/>
<Attribute Type="String" Name="检具9" Value=""/>
<Attribute Type="String" Name="检具10" Value=""/>
<Attribute Type="String" Name="检具11" Value=""/>
<Attribute Type="String" Name="检具12" Value=""/>
<Attribute Type="String" Name="签章" Value=""/>
<Attribute Type="String" Name="件号" Value="QT23007209901"/>
<Attribute Type="String" Name="材料" Value="6060 T6"/>
<Attribute Type="String" Name="图纸名称" Value="零件图"/>
<Attribute Type="String" Name="设计" Value="杨郝"/>
<Attribute Type="String" Name="校对" Value="杨郝"/>
<Attribute Type="String" Name="审核" Value="杨郝"/>
<Attribute Type="String" Name="批准" Value=""/>
<Attribute Type="String" Name="日期" Value=""/>
<Attribute Type="String" Name="外发图纸" Value=""/>
<Attribute Type="String" Name="激光打印区图纸" Value=""/>
<Attribute Type="String" Name="ERP" Value=""/>
<Attribute Type="String" Name="检具或封样同步调整" Value=""/>
<Attribute Type="String" Name="外协加工图纸" Value=""/>
</Title>
</SignInfo>
</PDMIntegration>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

@ -0,0 +1,388 @@
//==================================================
//
// Copyright 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
//
//==================================================
package com.connor.signoff.soa.handler;
import java.math.BigInteger;
import java.util.HashMap;
import java.util.Map;
import com.teamcenter.clientx.AppXSession;
import com.teamcenter.schemas.soa._2006_03.exceptions.ServiceException;
// Include the Data Management Service Interface
import com.teamcenter.services.strong.core.DataManagementService;
// Input and output structures for the service operations
// Note: the different namespace from the service interface
import com.teamcenter.services.strong.core._2006_03.DataManagement.CreateItemsOutput;
import com.teamcenter.services.strong.core._2006_03.DataManagement.CreateItemsResponse;
import com.teamcenter.services.strong.core._2006_03.DataManagement.ExtendedAttributes;
import com.teamcenter.services.strong.core._2006_03.DataManagement.GenerateItemIdsAndInitialRevisionIdsProperties;
import com.teamcenter.services.strong.core._2006_03.DataManagement.GenerateItemIdsAndInitialRevisionIdsResponse;
import com.teamcenter.services.strong.core._2006_03.DataManagement.GenerateRevisionIdsProperties;
import com.teamcenter.services.strong.core._2006_03.DataManagement.GenerateRevisionIdsResponse;
import com.teamcenter.services.strong.core._2006_03.DataManagement.ItemIdsAndInitialRevisionIds;
import com.teamcenter.services.strong.core._2006_03.DataManagement.ItemProperties;
import com.teamcenter.services.strong.core._2006_03.DataManagement.RevisionIds;
import com.teamcenter.services.strong.core._2007_01.DataManagement.CreateOrUpdateFormsResponse;
import com.teamcenter.services.strong.core._2007_01.DataManagement.FormAttributesInfo;
import com.teamcenter.services.strong.core._2007_01.DataManagement.FormInfo;
import com.teamcenter.services.strong.core._2007_01.DataManagement.GetItemCreationRelatedInfoResponse;
import com.teamcenter.services.strong.core._2008_06.DataManagement.ReviseInfo;
import com.teamcenter.services.strong.core._2008_06.DataManagement.ReviseResponse2;
import com.teamcenter.soa.client.model.ModelObject;
import com.teamcenter.soa.client.model.Property;
import com.teamcenter.soa.client.model.ServiceData;
import com.teamcenter.soa.client.model.strong.Item;
import com.teamcenter.soa.client.model.strong.ItemRevision;
import com.teamcenter.soa.exceptions.NotLoadedException;
/**
* Perform different operations in the DataManagementService
*
*/
public class DataManagement
{
/**
* Perform a sequence of data management operations: Create Items, Revise
* the Items, and Delete the Items
*
*/
public void createReviseAndDelete()
{
try
{
int numberOfItems = 3;
// Reserve Item IDs and Create Items with those IDs
ItemIdsAndInitialRevisionIds[] itemIds = generateItemIds(numberOfItems, "Item");
CreateItemsOutput[] newItems = createItems(itemIds, "Item");
// Copy the Item and ItemRevision to separate arrays for further
// processing
Item[] items = new Item[newItems.length];
ItemRevision[] itemRevs = new ItemRevision[newItems.length];
for (int i = 0; i < items.length; i++)
{
items[i] = newItems[i].item;
itemRevs[i] = newItems[i].itemRev;
}
// Reserve revision IDs and revise the Items
Map<BigInteger,RevisionIds> allRevIds = generateRevisionIds(items);
reviseItems(allRevIds, itemRevs);
// Delete all objects created
deleteItems(items);
}
catch (ServiceException e)
{
System.out.println(e.getMessage());
}
}
/**
* Reserve a number Item and Revision IDs
*
* @param numberOfIds Number of IDs to generate
* @param type Type of IDs to generate
*
* @return An array of Item and Revision IDs. The size of the array is equal
* to the input numberOfIds
*
* @throws ServiceException If any partial errors are returned
*/
public ItemIdsAndInitialRevisionIds[] generateItemIds(int numberOfIds, String type)
throws ServiceException
{
// Get the service stub
DataManagementService dmService = DataManagementService.getService(AppXSession.getConnection());
GenerateItemIdsAndInitialRevisionIdsProperties[] properties = new GenerateItemIdsAndInitialRevisionIdsProperties[1];
GenerateItemIdsAndInitialRevisionIdsProperties property = new GenerateItemIdsAndInitialRevisionIdsProperties();
property.count = numberOfIds;
property.itemType = type;
property.item = null; // Not used
properties[0] = property;
// *****************************
// Execute the service operation
// *****************************
GenerateItemIdsAndInitialRevisionIdsResponse response = dmService.generateItemIdsAndInitialRevisionIds(properties);
// The AppXPartialErrorListener is logging the partial errors returned
// In this simple example if any partial errors occur we will throw a
// ServiceException
if (response.serviceData.sizeOfPartialErrors() > 0)
throw new ServiceException( "DataManagementService.generateItemIdsAndInitialRevisionIds returned a partial error.");
// The return is a map of ItemIdsAndInitialRevisionIds keyed on the
// 0-based index of requested IDs. Since we only asked for IDs for one
// data type, the map key is '0'
BigInteger bIkey = new BigInteger("0");
@SuppressWarnings("unchecked")
Map<BigInteger,ItemIdsAndInitialRevisionIds[]> allNewIds = response.outputItemIdsAndInitialRevisionIds;
ItemIdsAndInitialRevisionIds[] myNewIds = allNewIds.get(bIkey);
return myNewIds;
}
/**
* Create Items
*
* @param itemIds Array of Item and Revision IDs
* @param itemType Type of item to create
*
* @return Set of Items and ItemRevisions
*
* @throws ServiceException If any partial errors are returned
*/
@SuppressWarnings("unchecked")
public CreateItemsOutput[] createItems(ItemIdsAndInitialRevisionIds[] itemIds, String itemType)
throws ServiceException
{
// Get the service stub
DataManagementService dmService = DataManagementService.getService(AppXSession.getConnection());
// Populate form type
GetItemCreationRelatedInfoResponse relatedResponse = dmService.getItemCreationRelatedInfo(itemType, null);
String[] formTypes = new String[0];
if ( relatedResponse.serviceData.sizeOfPartialErrors() > 0)
throw new ServiceException( "DataManagementService.getItemCretionRelatedInfo returned a partial error.");
formTypes = new String[relatedResponse.formAttrs.length];
for ( int i = 0; i < relatedResponse.formAttrs.length; i++ )
{
FormAttributesInfo attrInfo = relatedResponse.formAttrs[i];
formTypes[i] = attrInfo.formType;
}
ItemProperties[] itemProps = new ItemProperties[itemIds.length];
for (int i = 0; i < itemIds.length; i++)
{
// Create form in cache for form property population
ModelObject[] forms = createForms(itemIds[i].newItemId, formTypes[0],
itemIds[i].newRevId, formTypes[1],
null, false);
ItemProperties itemProperty = new ItemProperties();
itemProperty.clientId = "AppX-Test";
itemProperty.itemId = itemIds[i].newItemId;
itemProperty.revId = itemIds[i].newRevId;
itemProperty.name = "AppX-Test";
itemProperty.type = itemType;
itemProperty.description = "Test Item for the SOA AppX sample application.";
itemProperty.uom = "";
// Retrieve one of form attribute value from Item master form.
ServiceData serviceData = dmService.getProperties(forms, new String[]{"project_id"});
if ( serviceData.sizeOfPartialErrors() > 0)
throw new ServiceException( "DataManagementService.getProperties returned a partial error.");
Property property = null;
try
{
property= forms[0].getPropertyObject("project_id");
}
catch ( NotLoadedException ex){}
// Only if value is null, we set new value
if ( property == null || property.getStringValue() == null || property.getStringValue().length() == 0)
{
itemProperty.extendedAttributes = new ExtendedAttributes[1];
ExtendedAttributes theExtendedAttr = new ExtendedAttributes();
theExtendedAttr.attributes = new HashMap<String,String>();
theExtendedAttr.objectType = formTypes[0];
theExtendedAttr.attributes.put("project_id", "project_id");
itemProperty.extendedAttributes[0] = theExtendedAttr;
}
itemProps[i] = itemProperty;
}
// *****************************
// Execute the service operation
// *****************************
CreateItemsResponse response = dmService.createItems(itemProps, null, "");
// before control is returned the ChangedHandler will be called with
// newly created Item and ItemRevisions
// The AppXPartialErrorListener is logging the partial errors returned
// In this simple example if any partial errors occur we will throw a
// ServiceException
if (response.serviceData.sizeOfPartialErrors() > 0)
throw new ServiceException( "DataManagementService.createItems returned a partial error.");
return response.output;
}
/**
* Reserve Revision IDs
*
* @param items Array of Items to reserve IDs for
*
* @return Map of RevisionIds
*
* @throws ServiceException If any partial errors are returned
*/
@SuppressWarnings("unchecked")
public Map<BigInteger,RevisionIds> generateRevisionIds(Item[] items) throws ServiceException
{
// Get the service stub
DataManagementService dmService = DataManagementService.getService(AppXSession.getConnection());
GenerateRevisionIdsResponse response = null;
GenerateRevisionIdsProperties[] input = null;
input = new GenerateRevisionIdsProperties[items.length];
for (int i = 0; i < items.length; i++)
{
GenerateRevisionIdsProperties property = new GenerateRevisionIdsProperties();
property.item = items[i];
property.itemType = "";
input[i] = property;
}
// *****************************
// Execute the service operation
// *****************************
response = dmService.generateRevisionIds(input);
// The AppXPartialErrorListener is logging the partial errors returned
// In this simple example if any partial errors occur we will throw a
// ServiceException
if (response.serviceData.sizeOfPartialErrors() > 0)
throw new ServiceException( "DataManagementService.generateRevisionIds returned a partial error.");
return response.outputRevisionIds;
}
/**
* Revise Items
*
* @param revisionIds Map of Revision IDs
* @param itemRevs Array of ItemRevisons
*
* @return Map of Old ItemRevsion(key) to new ItemRevision(value)
*
* @throws ServiceException If any partial errors are returned
*/
public void reviseItems(Map<BigInteger,RevisionIds> revisionIds, ItemRevision[] itemRevs) throws ServiceException
{
// Get the service stub
DataManagementService dmService = DataManagementService.getService(AppXSession.getConnection());
ReviseInfo[] reviseInfo = new ReviseInfo[itemRevs.length];
for (int i = 0; i < itemRevs.length; i++)
{
String key = Integer.toString(i);
BigInteger bIkey = new BigInteger(key);
RevisionIds rev = revisionIds.get(bIkey);
reviseInfo[i] = new ReviseInfo();
reviseInfo[i].baseItemRevision = itemRevs[i];
reviseInfo[i].clientId = itemRevs[i].getUid()+ "--" + i;
reviseInfo[i].description = "describe testRevise";
reviseInfo[i].name = "testRevise";
reviseInfo[i].newRevId = rev.newRevId;
}
// *****************************
// Execute the service operation
// *****************************
ReviseResponse2 revised = dmService.revise2(reviseInfo);
// before control is returned the ChangedHandler will be called with
// newly created Item and ItemRevisions
// The AppXPartialErrorListener is logging the partial errors returned
// In this simple example if any partial errors occur we will throw a
// ServiceException
if (revised.serviceData.sizeOfPartialErrors() > 0)
throw new ServiceException("DataManagementService.revise returned a partial error.");
}
/**
* Delete the Items
*
* @param items Array of Items to delete
*
* @throws ServiceException If any partial errors are returned
*/
public void deleteItems(Item[] items) throws ServiceException
{
// Get the service stub
DataManagementService dmService = DataManagementService.getService(AppXSession.getConnection());
// *****************************
// Execute the service operation
// *****************************
ServiceData serviceData = dmService.deleteObjects(items);
// The AppXPartialErrorListener is logging the partial errors returned
// In this simple example if any partial errors occur we will throw a
// ServiceException
if (serviceData.sizeOfPartialErrors() > 0)
throw new ServiceException("DataManagementService.deleteObjects returned a partial error.");
}
/**
* Create ItemMasterForm and ItemRevisionMasterForm
*
* @param IMFormName Name of ItemMasterForm
* @param IMFormType Type of ItemMasterForm
* @param IRMFormName Name of ItemRevisionMasterForm
* @param IRMFormType Type of ItemRevisionMasterForm
* @param parent The container object that two
* newly-created forms will be added into.
* @return ModelObject[] Array of forms
*
* @throws ServiceException If any partial errors are returned
*/
public ModelObject[] createForms ( String IMFormName, String IMFormType,
String IRMFormName, String IRMFormType,
ModelObject parent, boolean saveDB ) throws ServiceException
{
//Get the service stub
DataManagementService dmService = DataManagementService.getService(AppXSession.getConnection());
FormInfo[] inputs = new FormInfo[2];
inputs[0] = new FormInfo();
inputs[0].clientId = "1";
inputs[0].description="";
inputs[0].name = IMFormName;
inputs[0].formType=IMFormType;
inputs[0].saveDB = saveDB;
inputs[0].parentObject = parent ;
inputs[1] = new FormInfo();
inputs[1].clientId = "2";
inputs[1].description="";
inputs[1].name = IRMFormName;
inputs[1].formType=IRMFormType;
inputs[1].saveDB = saveDB;
inputs[1].parentObject = parent;
CreateOrUpdateFormsResponse response = dmService.createOrUpdateForms(inputs);
if ( response.serviceData.sizeOfPartialErrors() > 0)
throw new ServiceException("DataManagementService.createForms returned a partial error.");
ModelObject[] forms = new ModelObject [inputs.length];
for (int i=0; i<inputs.length; ++i)
{
forms[i] = response.outputs[i].form;
}
return forms;
}
}

@ -0,0 +1,509 @@
package com.connor.signoff.soa.handler;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.net.SocketException;
import java.util.Properties;
import org.apache.commons.net.ftp.FTPClient;
import org.apache.commons.net.ftp.FTPFile;
import org.apache.commons.net.ftp.FTPReply;
import com.teamcenter.services.strong.administration.*;
public class FTPUtils {
public static final boolean debug = true;
public static String ftpUserName = "";// plm
public static String ftpPassword = "";// 本地hxgs888hzq 宏协hxgs888
public static String ftpHost = "";// 本地192.168.0.139 宏协192.168.2.240
public static String ftpPath = "";
public static String CompanyName = "";
public static String FTPLinkInfo = "";
public static int ftpPort = 0;// 2122这是转pdf的port2121才是属性映射的port
// public static TCSession session = RACUIUtil.getTCSession();
public static int count = 0;// 半秒
public static int waitOkOrErrFileCount = 0;
public static int waitPdf = 0;
/**
*
* @param tcp
* @param args
*/
public static void getConfigureInfomationg(PreferenceManagementService tcp, String args) {
// String tcRoot = getTCPlugin() + "\\" + "sign.config";
// Properties properties = getProperties(tcRoot);
// try {
// CompanyName = args;
// waitPdf = Integer.valueOf(properties.getProperty("WAITPDF"));
// } catch (Exception e) {
// e.printStackTrace();
// }
Properties prop2 = new Properties();
InputStream resourceAsStream = FTPUtils.class.getResourceAsStream("PDFInfo.properties");
if (resourceAsStream != null) {
try {
prop2.load(resourceAsStream);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
waitPdf = Integer.valueOf(prop2.getProperty("WAITPDF"));
System.out.println("waitPdf:"+waitPdf);
} else {
System.err.println("无法找到配置文件 ftp.properties");
}
if (debug)
System.out.println(CompanyName);
FTPLinkInfo = args;
System.out.println("FTPLinkInfo:" + FTPLinkInfo);
String[] ftpValues = new String[5];
// TODO Auto-generated method stub
System.out.println("开始远程连接数据库\n开始读取配置文件");
// 加载配置文件
Properties prop = new Properties();
InputStream fis = null;
try {
// 获取当前类的类加载器,用于找到资源文件
fis = FTPUtils.class.getResourceAsStream("ftp.properties");
if (fis != null) {
prop.load(fis);
} else {
System.err.println("无法找到配置文件 ftp.properties");
}
// 读取配置
String ip = prop.getProperty("ip");
System.out.println("ip:"+ip);
ftpValues[0] = ip;
String port = prop.getProperty("port");
System.out.println("port:"+port);
ftpValues[1] = port;
String username = prop.getProperty("username");
System.out.println("username:"+username);
ftpValues[2] = username;
String password = prop.getProperty("password");
System.out.println("password:"+password);
ftpValues[3] = password;
String path = prop.getProperty("path");
System.out.println("path:"+path);
ftpValues[4] = path;
}catch (Exception e) {
e.printStackTrace();
}
// = session.getPreferenceService().getStringValues(FTPLinkInfo);
ftpHost = ftpValues[0];
ftpPort = Integer.valueOf(ftpValues[1]);
ftpUserName = ftpValues[2];
ftpPassword = ftpValues[3];
ftpPath = ftpValues[4];
if (debug) {
System.out.println("ip:" + ftpHost);
System.out.println("port:" + ftpPort);
System.out.println("user:" + ftpUserName);
System.out.println("password:" + ftpPassword);
System.out.println("caxadir:" + ftpPath);
}
}
/**
* Description: FTP
*
* @param ftpHost FTPhostname
* @param ftpUserName
* @param ftpPassword
* @param ftpPort
* @param ftpPath FTP ftptest/aa
* @param fileName ftp
* @param in
* @return truefalse
*/
//FTPUtils.uploadFile(ip, user, password, port, caxadir, tempCaxaPathName, tempCaxaPathIn);
public static boolean uploadFile(String fileName, FileInputStream in) {
boolean success = false;
FTPClient ftpClient = null;
try {
int reply;
ftpClient = getFTPClient(ftpHost, ftpUserName, ftpPassword, ftpPort);
reply = ftpClient.getReplyCode();
if (!FTPReply.isPositiveCompletion(reply)) {
ftpClient.disconnect();
return success;
}
ftpClient.setControlEncoding("GBK"); // 中文支持
// fileName = new String(fileName.getBytes("GBK"),"iso-8859-1");//TODO
ftpClient.setFileType(FTPClient.BINARY_FILE_TYPE);
ftpClient.enterLocalPassiveMode();
ftpClient.changeWorkingDirectory(ftpPath);
ftpClient.storeFile(convGBKToISO(fileName), in);//中文支持
//ftpClient.storeFile(fileName, in);//默认方法,可能不支持中文
in.close();
ftpClient.logout();
success = true;
} catch (IOException e) {
e.printStackTrace();
} finally {
if (ftpClient.isConnected()) {
try {
ftpClient.disconnect();
} catch (IOException ioe) {
}
}
}
return success;
}
public static boolean downOkOrErrFile(
String fileName, // 要下载的文件名
String localPath// 下载后保存到本地的路径
) {
boolean success = false;
FTPClient ftp = new FTPClient();
try {
int reply;
ftp = getFTPClient(ftpHost, ftpUserName, ftpPassword, ftpPort);
// ftp.login("anonymous", null);// 登陆FTP服务器
reply = ftp.getReplyCode();
if (!FTPReply.isPositiveCompletion(reply)) {
ftp.disconnect();
return success;
}
ftp.enterLocalPassiveMode();// 不用这句有些电脑打开了防火墙就会在ftp.listFiles()这里卡住
// System.out.println("aaa");
boolean ftpchange = ftp.changeWorkingDirectory(ftpPath);// 转移到FTP服务器目录
// System.out.println(ftpchange);
// FTPFile[] fs = ftp.listFiles();
String errorNamePrefix = "";
if (fileName.toLowerCase().endsWith(".exb")) {
errorNamePrefix = fileName ;
}
waitOkOrErrFileCount = 0 ;
FTPFile[] fs = waitOkOrErrFile(ftp, fileName, errorNamePrefix);
if (fs != null) {
success = true;
} else {
success = false;
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (ftp.isConnected()) {
try {
ftp.disconnect();
} catch (IOException ioe) {
}
}
}
return success;
}
public static FTPFile[] waitOkOrErrFile(FTPClient ftp, String fileName, String errorNamePrefix) {
FTPFile[] fs = null;
try {
fs = ftp.listFiles();
} catch (IOException e1) {
e1.printStackTrace();
}
System.out.println("errorNamePrefix:"+errorNamePrefix);
for (FTPFile ff : fs) {
//2023.04.06如果找到.ok即为成功.error即为失败不用再找了
// FTP中文支持
String ffName = convISOtoGBK(ff.getName());
System.out.println("ffName:"+ffName);
if (ffName.equals(errorNamePrefix + ".ok")) {
System.out.println("映射成功...");
return fs;
} else if (ffName.equals(errorNamePrefix + ".err")) {
System.out.println("映射异常");
return null;
}
}
System.out.println("waitOkOrErrFile---"+errorNamePrefix);
try {
Thread.sleep(1000);
waitOkOrErrFileCount++;
} catch (InterruptedException e) {
e.printStackTrace();
}
// 如果超时,退出
if (waitOkOrErrFileCount > waitPdf) {
return null;
}
fs = waitOkOrErrFile(ftp, fileName, errorNamePrefix);
return fs;
}
/**
* Description: FTP
*
* @param ftpHost FTPhostname
* @param ftpUserName
* @param ftpPassword
* @param ftpPort
* @param ftpPath FTP ftptest/aa
* @param fileName ftp
* @param in
* @return truefalse
*/
public static boolean deleteTxt(
String fileName, // 要下载的文件名
String localPath// 下载后保存到本地的路径
) {
boolean success = false;
FTPClient ftp = new FTPClient();
try {
int reply;
ftp = getFTPClient(ftpHost, ftpUserName, ftpPassword, ftpPort);
// ftp.login("anonymous", null);// 登陆FTP服务器
reply = ftp.getReplyCode();
if (!FTPReply.isPositiveCompletion(reply)) {
ftp.disconnect();
return success;
}
ftp.enterLocalPassiveMode();// 不用这句有些电脑打开了防火墙就会在ftp.listFiles()这里卡住
// System.out.println("aaa");
boolean ftpchange = ftp.changeWorkingDirectory(ftpPath);// 转移到FTP服务器目录
fileName = fileName.replace(".exb", ".txt");
ftp.setControlEncoding("GBK"); //FTP 中文支持
fileName = convGBKToISO(fileName);//FTP 中文支持
ftp.dele(fileName);
success=true;
} catch (IOException e) {
e.printStackTrace();
} finally {
if (ftp.isConnected()) {
try {
ftp.disconnect();
} catch (IOException ioe) {
}
}
}
return success;
}
public static boolean downFile(
String fileName, // 要下载的文件名
String localPath// 下载后保存到本地的路径
) {
boolean success = false;
FTPClient ftp = new FTPClient();
try {
int reply;
ftp = getFTPClient(ftpHost, ftpUserName, ftpPassword, ftpPort);
reply = ftp.getReplyCode();
if (!FTPReply.isPositiveCompletion(reply)) {
ftp.disconnect();
return success;
}
ftp.enterLocalPassiveMode();// 不用这句有些电脑打开了防火墙就会在ftp.listFiles()这里卡住
// System.out.println("aaa");
boolean ftpchange = ftp.changeWorkingDirectory(ftpPath);// 转移到FTP服务器目录
// System.out.println(ftpchange);
// FTPFile[] fs = ftp.listFiles();
String errorName = "";
if (fileName.toLowerCase().endsWith(".pdf")) {
errorName = fileName + ".err";
} else if (fileName.toLowerCase().endsWith(".exb")) {
errorName = fileName + ".err";
}
String okName= fileName + ".ok";
File localFile = new File(localPath + "/" + fileName);
count = 0;
FTPFile[] fs = waitPdf(ftp, fileName, errorName,okName);
if (fs != null) {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
ftp.setControlEncoding("GBK");
for (FTPFile ff : fs) {
// FTP中文支持
String ffName = convISOtoGBK(ff.getName());
if (ffName.equals(fileName)) {
OutputStream is = new FileOutputStream(localFile);
ftp.retrieveFile(ff.getName(), is);
// System.out.println("ccc" +ff.getName()+fileName);
is.close();
break;
}
}
ftp.logout();
success = true;
} else {
success = false;
}
} catch (IOException e) {
e.printStackTrace();
} finally {
if (ftp.isConnected()) {
try {
ftp.disconnect();
} catch (IOException ioe) {
}
}
}
return success;
}
public static FTPFile[] waitPdf(FTPClient ftp, String fileName, String errorName,String okName) {
FTPFile[] fs = null;
try {
fs = ftp.listFiles();
} catch (IOException e1) {
e1.printStackTrace();
}
for (FTPFile ff : fs) {
//2023.04.06如果找到.ok即为成功.error即为失败不用再找了
//FTP中文支持
String ffName = convISOtoGBK(ff.getName());
if (ffName.equals(okName)) {
System.out.println("find the pdf...");
return fs;
} else if (ffName.equals(errorName)) {
System.out.println("转换异常");
return null;
}
}
System.out.println("waitPdf---count:"+count);
System.out.println("waitPdf----waitPdf:"+waitPdf);
try {
Thread.sleep(1000);
count++;
} catch (InterruptedException e) {
e.printStackTrace();
}
// 如果超时,退出
if (count > waitPdf) {
return null;
}
fs = waitPdf(ftp, fileName, errorName,okName);
return fs;
}
/**
* ISOGBK
* FTPwin
* @param fileNameGBK
* @return
*/
public static String convISOtoGBK(String fileNameISO) {
String filenameGBK="";
try {
filenameGBK = new String(fileNameISO.getBytes("iso-8859-1"),"GBK");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return filenameGBK;
}
/**
* GBKISO
* FTP
* @param fileNameGBK
* @return
*/
public static String convGBKToISO(String fileNameISO) {
String filenameISO="";
try {
filenameISO = new String(fileNameISO.getBytes("GBK"),"iso-8859-1");
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return filenameISO;
}
/**
* FTPClient
*
* @param ftpHost FTP
* @param ftpPassword FTP
* @param ftpUserName FTP
* @param ftpPort FTP 21
* @return
*/
public static FTPClient getFTPClient(String ftpHost, String ftpUserName, String ftpPassword, int ftpPort) {
FTPClient ftpClient = new FTPClient();
try {
ftpClient = new FTPClient();
ftpClient.connect(ftpHost, ftpPort);// 连接FTP服务器
ftpClient.login(ftpUserName, ftpPassword);// 登陆FTP服务器
// ftpClient.login("anonymous", null);// 登陆FTP服务器
if (!FTPReply.isPositiveCompletion(ftpClient.getReplyCode())) {
System.out.println("未连接到FTP用户名或密码错误。");
ftpClient.disconnect();
} else {
System.out.println("FTP连接成功。");
}
} catch (SocketException e) {
e.printStackTrace();
System.out.println("FTP的IP地址可能错误请正确配置。");
} catch (IOException e) {
e.printStackTrace();
System.out.println("FTP的端口错误,请正确配置。");
}
return ftpClient;
}
/**
* jarplugin
*
* @param
* @return
*/
public static String getTCPlugin() {
String path2 = "";
path2 = OpenDatasetSignoff.class.getProtectionDomain().getCodeSource().getLocation().getPath();// 获得tc的plugins下的jar包的绝对路径
path2 = path2.replace("%20", " ");
System.out.println("plugin路径:" + path2);
File file = new File(path2);
try {
System.out.println("file.getParent:" + file.getParent());
} catch (Exception e) {
e.printStackTrace();
}
path2 = file.getParent() + "//";
System.out.println("plugin路径:" + path2);
return path2;
}
/**
*
*
* @param
* @return
*/
public static Properties getProperties(String fileName) {
Properties properties = new Properties();
try {
InputStream inputStream = new FileInputStream(fileName);
properties.load(inputStream);
} catch (IOException e) {
e.printStackTrace();
}
return properties;
}
}

@ -0,0 +1,87 @@
//==================================================
//
// Copyright 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
//
//==================================================
package com.connor.signoff.soa.handler;
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
* Teamcenter Services framework and a few of the services.
*
* An instance of the Connection object is created with implementations of the
* ExceptionHandler, PartialErrorListener, ChangeListener, and DeleteListeners
* intefaces. This client application performs the following functions:
* 1. Establishes a session with the Teamcenter server
* 2. Display the contents of the Home Folder
* 3. Performs a simple query of the database
* 4. Create, revise, and delete an Item
*
*/
public class Hello
{
/**
* @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.hello.Hello");
System.exit(0);
}
}
// Get optional host information
String serverHost = "http://192.168.2.242:7001/tc";
String host = System.getProperty("host");
if (host != null && host.length() > 0)
{
serverHost = host;
}
AppXSession session = new AppXSession(serverHost);
HomeFolder home = new HomeFolder();
Query query = new Query();
DataManagement dm = new DataManagement();
// Establish a session with the Teamcenter Server
User user = session.login();
// Using the User object returned from the login service request
// display the contents of the Home Folder
home.listHomeFolder(user);
// Perform a simple query of the database
query.queryItems();
// Perform some basic data management functions
dm.createReviseAndDelete();
// Terminate the session with the Teamcenter server
session.logout();
}
}

@ -0,0 +1,75 @@
//==================================================
//
// Copyright 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
//
//==================================================
package com.connor.signoff.soa.handler;
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,41 @@
package com.connor.signoff.soa.handler;
public class JFomPdfBean {
private Float w = 0.0f;
private Float h = 0.0f;
private Float wi = 0.0f;
private Float hi = 0.0f;
public Float getW() {
return w;
}
public void setW(Float w) {
this.w = w;
}
public Float getH() {
return h;
}
public void setH(Float h) {
this.h = h;
}
public Float getWi() {
return wi;
}
public void setWi(Float wi) {
this.wi = wi;
}
public Float getHi() {
return hi;
}
public void setHi(Float hi) {
this.hi = hi;
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,27 @@
#A4
A4_PRODUCT=82,747
A4H_PRODUCT=60,500
#A3
#A3=37,753
A3_PRODUCT=75,750
A3H_PRODUCT=100,1100
A3_ECN=62,762
A3_GY=31,759
A3_TYGY=29,759
#A3=43,737
#A2
A2_PRODUCT=43,1077
A2_GY1=54,1601
A2_GY2=54,725
A2_GZT1=12,706
A2_GZT2=1035,979
A2_TYGY1=54,1601
A2_TYGY2=54,726
#A1
A1_PRODUCT=150,1580
#A0
A0_PRODUCT=150,2241
A0_GZT1=12,2151
A0_GZT2=1908,2151
WAITPDF=120

@ -0,0 +1,136 @@
//==================================================
//
// Copyright 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
//
//==================================================
package com.connor.signoff.soa.handler;
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.ServiceData;
import com.teamcenter.soa.client.model.strong.ImanQuery;
public class Query
{
/**
* Perform a simple query of the database
*
*/
public void queryItems()
{
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;
}
// Find one called 'Item Name'
for (int i = 0; i < savedQueries.queries.length; i++)
{
if (savedQueries.queries[i].name.equals("Item Name"))
{
query = savedQueries.queries[i].query;
break;
}
}
}
catch (ServiceException e)
{
System.out.println("GetSavedQueries service request failed.");
System.out.println(e.getMessage());
return;
}
if (query == null)
{
System.out.println("There is not an 'Item Name' query.");
return;
}
try
{
//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 = new String[]{"Item Name" };
savedQueryInput[0].values = new String[1];
savedQueryInput[0].values[0] = "*";
//*****************************
//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
for(int i=0; i< found.objectUIDS.length; i+=10)
{
int pageSize = (i+10<found.objectUIDS.length)? 10:found.objectUIDS.length-i;
String[] uids = new String[pageSize];
for(int j=0; j<pageSize; j++)
{
uids[j]= found.objectUIDS[i+j];
}
ServiceData sd = dmService.loadObjects( uids );
ModelObject[] foundObjs = new ModelObject[ sd.sizeOfPlainObjects()];
for( int k =0; k< sd.sizeOfPlainObjects(); k++)
{
foundObjs[k] = sd.getPlainObject(k);
}
AppXSession.printObjects( foundObjs );
}
}
catch (Exception e)
{
System.out.println("ExecuteSavedQuery service request failed.");
System.out.println(e.getMessage());
return;
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,5 @@
ip=10.10.10.22
port=21
username=infodba
password=infodba
path=D:\\CAXAPLM

@ -0,0 +1,12 @@
*TITLE\:\u7F16\u5236=REV.u2_bianzhi_name
*TITLE\:\u7F16\u5236\u65E5\u671F=REV.u2_bianzhi_date
*TITLE\:\u6807\u51c6\u5316=REV.u2_biaozhunhua_name
*TITLE\:\u6807\u51c6\u5316\u65e5\u671f=REV.u2_biaozhunhua_date
*TITLE\:\u5de5\u827a=REV.u2_gongyi_name
*TITLE\:\u5de5\u827a\u65e5\u671f=REV.u2_gongyi_date
*TITLE\:\u6821\u5bf9=REV.u2_jiaodui_name
*TITLE\:\u6821\u5bf9\u65e5\u671f=REV.u2_jiaodui_date
*TITLE\:\u6279\u51C6=REV.u2_pizhun_name
*TITLE\:\u6279\u51C6\u65E5\u671F=REV.u2_pizhun_date
*TITLE\:\u5BA1\u6838=REV.u2_shenhe_name
*TITLE\:\u5BA1\u6838\u65E5\u671F=REV.u2_shenhe_date

@ -0,0 +1,48 @@
/** * @Title: test.java
* @Package com.connor.signoff.soa.handler
* @Description: TODO()
* @author admin * @date 2024712
* @version V1.0
*/
package com.connor.signoff.soa.handler;
import java.io.InputStream;
import java.util.Properties;
import java.nio.charset.StandardCharsets;
import java.net.URLDecoder;
/**
* @ClassName: test
* @Description: TODO()
* @author admin
* @date 2024712
*
*/
public class test {
public static void main(String[] args) {
// 从类路径中读取配置文件
InputStream resourceAsStream = test.class.getResourceAsStream("signoff.properties");
// 读取配置文件内容
Properties properties = new Properties();
try {
properties.load(resourceAsStream);
} catch (Exception e) {
System.out.println("配置读取失败");
e.printStackTrace();
return;
}
// 获取所有配置项
for (String key : properties.stringPropertyNames()) {
String value = properties.getProperty(key);
// 解码键中的转义字符和Unicode编码
String decodedKey = URLDecoder.decode(key.replace("\\:", ":"));
String decodedValue = URLDecoder.decode(value);
System.out.println("解码后键值: " + decodedKey + "=" + decodedValue);
}
}
}

@ -0,0 +1,67 @@
/** * @Title: testLogin.java
* @Package com.connor.signoff.soa.handler
* @Description: TODO()
* @author admin * @date 2024925
* @version V1.0
*/
package com.connor.signoff.soa.handler;
import java.io.FileNotFoundException;
import com.teamcenter.clientx.AppXSession;
import com.teamcenter.services.strong.administration.PreferenceManagementService;
import com.teamcenter.services.strong.core.DataManagementService;
import com.teamcenter.soa.client.FileManagementUtility;
import com.teamcenter.soa.client.model.ModelObject;
import com.teamcenter.soa.client.model.strong.ItemRevision;
import com.teamcenter.soa.client.model.strong.User;
import com.teamcenter.soa.exceptions.NotLoadedException;
/**
* @ClassName: testLogin
* @Description: TODO()
* @author admin
* @date 2024925
*
*/
public class testLogin {
public static void main(String[] args) throws NotLoadedException {
if(args.length > 0) {
String id = args[0];
System.out.println("id"+id);
//开始登录
String serverHost = "http://10.10.10.35:8080/tc";
String host = System.getProperty("host");
if (host != null && host.length() > 0) {
serverHost = host;
}
AppXSession session = new AppXSession(serverHost);
User user = session.login();
DataManagementService dmService = DataManagementService.getService(AppXSession.getConnection());
try {
FileManagementUtility fileManagementUtility = new FileManagementUtility(AppXSession.getConnection(),
null,
new String[] { "http://10.10.10.35:4544" },
new String[] { "http://10.10.10.35:4544" },
"D://TEMP//fcc_tmp");
PreferenceManagementService service2 = PreferenceManagementService.getService(AppXSession.getConnection());
ItemRevision rev = null;
rev = (ItemRevision) dmService.loadObjects(new String[] {id}).getPlainObject(0);
ModelObject plainObject = dmService.loadObjects(new String[] {id}).getPlainObject(0);
dmService.getProperties(new ModelObject[]{plainObject}, new String[]{"item_id"});
String propertyDisplayableValue = plainObject.getPropertyDisplayableValue("item_id");
System.out.println("id:"+propertyDisplayableValue);
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}else {
System.out.println("传入参数有误");
}
}
}

@ -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 com.teamcenter.soa.client.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 com.teamcenter.soa.client.CredentialManager#getCredentials(com.teamcenter.schemas.soa._2006_03.exceptions.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 com.teamcenter.soa.client.CredentialManager#getCredentials(com.teamcenter.schemas.soa._2006_03.exceptions.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 com.teamcenter.soa.client.CredentialManager#setGroupRole(java.lang.String,
* java.lang.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 com.teamcenter.soa.client.CredentialManager#setUserPassword(java.lang.String,
* java.lang.String, java.lang.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 = "infodba";
if (name.length() == 0)
throw new CanceledOperationException("");
// System.out.print("Password: ");
// password = reader.readLine();
password = "sdpxqc";
}
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,63 @@
//==================================================
//
// Copyright 2012 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.
//
//==================================================
package com.teamcenter.clientx;
import com.teamcenter.soa.client.model.*;
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,285 @@
//==================================================
//
// 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.Random;
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.services.strong.core._2006_03.Session;
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;
}
/**
* 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],"zh_CN", Math.random()+"");
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);
}
public User mylogin(String name, String password) {
SessionService sessionService = SessionService.getService(connection);
try {
Session.LoginResponse out = sessionService.login(name, password,
"", "", "", "");
return out.user;
} catch (InvalidCredentialsException e) {
e.printStackTrace();
return null;
}
}
}

@ -0,0 +1,71 @@
package com.teamcenter.filemanagement;
import com.teamcenter.clientx.AppXSession;
import com.teamcenter.services.strong.core.SessionService;
import com.teamcenter.soa.client.model.Property;
import com.teamcenter.soa.client.model.ServiceData;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
public class FMS {
public static void main(String[] args) {
System.out.println("upload:" + args.length);
if (args.length < 2)
return;
String filePath = args[0];
System.out.println("filePath===========" + filePath);
System.out.println("args[1]===========" + args[1]);
System.out.println("args[2]===========" + args[2]);
System.out.println("args[3]===========" + args[3]);
File file = new File(filePath);
if (!file.exists())
return;
String str = null;
try {
BufferedReader reader = new BufferedReader(new FileReader(file));
str = reader.readLine();
reader.close();
} catch (IOException e1) {
e1.printStackTrace();
}
System.out.println("str===========" + str);
if (str == null)
return;
String[] infos = new String[3];
StringBuilder sb = new StringBuilder();
String[] values = str.split("\\|");
if (values != null && values.length == 3)
for (int i = 0; i < values.length; i++) {
infos[i] = values[i];
System.out.println("values[" + i + "]===========" + values[i]);
}
if (infos.length < 3)
return;
AppXSession session = new AppXSession(infos[0]);
try {
FileManagement fm = new FileManagement();
session.mylogin("infodba", "infodba");
if (args[1].split("\\|").length != args[2].split("\\|").length
|| args[2].split("\\|").length != args[3].split("\\|").length) {
System.out.println(args[1].split("\\|").length);
System.out.println(args[2].split("\\|").length);
System.out.println(args[3].split("\\|").length);
System.out.println("Êý¾Ý´íÎó");
}
String[] split1 = args[1].split("\\|");
String[] split2 = args[2].split("\\|");
String[] split3 = args[3].split("\\|");
for (int i = 0; i < split1.length; i++) {
fm.uploadFiles(split1[i], split2[i], split3[i]);
}
} catch (Exception e) {
e.printStackTrace();
}
session.logout();
}
}

@ -0,0 +1,10 @@
package com.teamcenter.filemanagement;
public class FileManagement {
public void uploadFiles(String string, String string2, String string3) {
// TODO Auto-generated method stub
}
}

@ -0,0 +1,12 @@
package com.teamcenter.filemanagement;
public class test {
public static void main(String[] args) {
String string = "value1|value2|value3";
String input = string;
String[] parts = input.split("\\|"); // 实际上不需要转义
for (String part : parts) {
System.out.println(part);
}
}
}

@ -0,0 +1,40 @@
#==================================================
#
# @<COPYRIGHT>@
#
#==================================================
# ============================================================================ #
# Set the Logging for the entire Web Application. #
# The Level can be DEBUG, INFO, WARN, ERROR, FATAL, or OFF #
# There are two predefined Appenders, TheConsole and AppLogFile #
# ============================================================================ #
log4j.rootLogger = WARN, TheConsole
#log4j.logger.org.apache.commons.httpclient = WARN, TheConsole
# ============================================================================ #
# The "TheConsole" Appender will write the log message to the console #
# (System.out) with the pattern specified below #
# ============================================================================ #
log4j.appender.TheConsole = org.apache.log4j.ConsoleAppender
log4j.appender.TheConsole.layout = org.apache.log4j.PatternLayout
log4j.appender.TheConsole.layout.ConversionPattern = %d{MM-dd HH:mm:ss} %x %-5p %c - %m%n
# ============================================================================ #
# The "AppLogFile" Appender will write the log message to a log file #
# with the pattern and other attributes specified below. #
# ============================================================================ #
log4j.appender.AppLogFile = org.apache.log4j.RollingFileAppender
log4j.appender.AppLogFile.layout = org.apache.log4j.PatternLayout
log4j.appender.AppLogFile.layout.ConversionPattern = %d{MM-dd HH:mm:ss} %x %-5p %c - %m%n
log4j.appender.AppLogFile.MaxBackupIndex = 1
log4j.appender.AppLogFile.MaxFileSize = 10MB
log4j.appender.AppLogFile.Append = false
log4j.appender.AppLogFile.File = SoaSampleServices.log

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Loading…
Cancel
Save