commit
8938e09ab7
@ -0,0 +1,63 @@
|
|||||||
|
###############################################################################
|
||||||
|
# Set default behavior to automatically normalize line endings.
|
||||||
|
###############################################################################
|
||||||
|
* text=auto
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Set default behavior for command prompt diff.
|
||||||
|
#
|
||||||
|
# This is need for earlier builds of msysgit that does not have it on by
|
||||||
|
# default for csharp files.
|
||||||
|
# Note: This is only used by command line
|
||||||
|
###############################################################################
|
||||||
|
#*.cs diff=csharp
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Set the merge driver for project and solution files
|
||||||
|
#
|
||||||
|
# Merging from the command prompt will add diff markers to the files if there
|
||||||
|
# are conflicts (Merging from VS is not affected by the settings below, in VS
|
||||||
|
# the diff markers are never inserted). Diff markers may cause the following
|
||||||
|
# file extensions to fail to load in VS. An alternative would be to treat
|
||||||
|
# these files as binary and thus will always conflict and require user
|
||||||
|
# intervention with every merge. To do so, just uncomment the entries below
|
||||||
|
###############################################################################
|
||||||
|
#*.sln merge=binary
|
||||||
|
#*.csproj merge=binary
|
||||||
|
#*.vbproj merge=binary
|
||||||
|
#*.vcxproj merge=binary
|
||||||
|
#*.vcproj merge=binary
|
||||||
|
#*.dbproj merge=binary
|
||||||
|
#*.fsproj merge=binary
|
||||||
|
#*.lsproj merge=binary
|
||||||
|
#*.wixproj merge=binary
|
||||||
|
#*.modelproj merge=binary
|
||||||
|
#*.sqlproj merge=binary
|
||||||
|
#*.wwaproj merge=binary
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# behavior for image files
|
||||||
|
#
|
||||||
|
# image files are treated as binary by default.
|
||||||
|
###############################################################################
|
||||||
|
#*.jpg binary
|
||||||
|
#*.png binary
|
||||||
|
#*.gif binary
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# diff behavior for common document formats
|
||||||
|
#
|
||||||
|
# Convert binary document formats to text before diffing them. This feature
|
||||||
|
# is only available from the command line. Turn it on by uncommenting the
|
||||||
|
# entries below.
|
||||||
|
###############################################################################
|
||||||
|
#*.doc diff=astextplain
|
||||||
|
#*.DOC diff=astextplain
|
||||||
|
#*.docx diff=astextplain
|
||||||
|
#*.DOCX diff=astextplain
|
||||||
|
#*.dot diff=astextplain
|
||||||
|
#*.DOT diff=astextplain
|
||||||
|
#*.pdf diff=astextplain
|
||||||
|
#*.PDF diff=astextplain
|
||||||
|
#*.rtf diff=astextplain
|
||||||
|
#*.RTF diff=astextplain
|
||||||
@ -0,0 +1,363 @@
|
|||||||
|
## Ignore Visual Studio temporary files, build results, and
|
||||||
|
## files generated by popular Visual Studio add-ons.
|
||||||
|
##
|
||||||
|
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||||
|
|
||||||
|
# User-specific files
|
||||||
|
*.rsuser
|
||||||
|
*.suo
|
||||||
|
*.user
|
||||||
|
*.userosscache
|
||||||
|
*.sln.docstates
|
||||||
|
|
||||||
|
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||||
|
*.userprefs
|
||||||
|
|
||||||
|
# Mono auto generated files
|
||||||
|
mono_crash.*
|
||||||
|
|
||||||
|
# Build results
|
||||||
|
[Dd]ebug/
|
||||||
|
[Dd]ebugPublic/
|
||||||
|
[Rr]elease/
|
||||||
|
[Rr]eleases/
|
||||||
|
x64/
|
||||||
|
x86/
|
||||||
|
[Ww][Ii][Nn]32/
|
||||||
|
[Aa][Rr][Mm]/
|
||||||
|
[Aa][Rr][Mm]64/
|
||||||
|
bld/
|
||||||
|
[Bb]in/
|
||||||
|
[Oo]bj/
|
||||||
|
[Oo]ut/
|
||||||
|
[Ll]og/
|
||||||
|
[Ll]ogs/
|
||||||
|
|
||||||
|
# Visual Studio 2015/2017 cache/options directory
|
||||||
|
.vs/
|
||||||
|
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||||
|
#wwwroot/
|
||||||
|
|
||||||
|
# Visual Studio 2017 auto generated files
|
||||||
|
Generated\ Files/
|
||||||
|
|
||||||
|
# MSTest test Results
|
||||||
|
[Tt]est[Rr]esult*/
|
||||||
|
[Bb]uild[Ll]og.*
|
||||||
|
|
||||||
|
# NUnit
|
||||||
|
*.VisualState.xml
|
||||||
|
TestResult.xml
|
||||||
|
nunit-*.xml
|
||||||
|
|
||||||
|
# Build Results of an ATL Project
|
||||||
|
[Dd]ebugPS/
|
||||||
|
[Rr]eleasePS/
|
||||||
|
dlldata.c
|
||||||
|
|
||||||
|
# Benchmark Results
|
||||||
|
BenchmarkDotNet.Artifacts/
|
||||||
|
|
||||||
|
# .NET Core
|
||||||
|
project.lock.json
|
||||||
|
project.fragment.lock.json
|
||||||
|
artifacts/
|
||||||
|
|
||||||
|
# ASP.NET Scaffolding
|
||||||
|
ScaffoldingReadMe.txt
|
||||||
|
|
||||||
|
# StyleCop
|
||||||
|
StyleCopReport.xml
|
||||||
|
|
||||||
|
# Files built by Visual Studio
|
||||||
|
*_i.c
|
||||||
|
*_p.c
|
||||||
|
*_h.h
|
||||||
|
*.ilk
|
||||||
|
*.meta
|
||||||
|
*.obj
|
||||||
|
*.iobj
|
||||||
|
*.pch
|
||||||
|
*.pdb
|
||||||
|
*.ipdb
|
||||||
|
*.pgc
|
||||||
|
*.pgd
|
||||||
|
*.rsp
|
||||||
|
*.sbr
|
||||||
|
*.tlb
|
||||||
|
*.tli
|
||||||
|
*.tlh
|
||||||
|
*.tmp
|
||||||
|
*.tmp_proj
|
||||||
|
*_wpftmp.csproj
|
||||||
|
*.log
|
||||||
|
*.vspscc
|
||||||
|
*.vssscc
|
||||||
|
.builds
|
||||||
|
*.pidb
|
||||||
|
*.svclog
|
||||||
|
*.scc
|
||||||
|
|
||||||
|
# Chutzpah Test files
|
||||||
|
_Chutzpah*
|
||||||
|
|
||||||
|
# Visual C++ cache files
|
||||||
|
ipch/
|
||||||
|
*.aps
|
||||||
|
*.ncb
|
||||||
|
*.opendb
|
||||||
|
*.opensdf
|
||||||
|
*.sdf
|
||||||
|
*.cachefile
|
||||||
|
*.VC.db
|
||||||
|
*.VC.VC.opendb
|
||||||
|
|
||||||
|
# Visual Studio profiler
|
||||||
|
*.psess
|
||||||
|
*.vsp
|
||||||
|
*.vspx
|
||||||
|
*.sap
|
||||||
|
|
||||||
|
# Visual Studio Trace Files
|
||||||
|
*.e2e
|
||||||
|
|
||||||
|
# TFS 2012 Local Workspace
|
||||||
|
$tf/
|
||||||
|
|
||||||
|
# Guidance Automation Toolkit
|
||||||
|
*.gpState
|
||||||
|
|
||||||
|
# ReSharper is a .NET coding add-in
|
||||||
|
_ReSharper*/
|
||||||
|
*.[Rr]e[Ss]harper
|
||||||
|
*.DotSettings.user
|
||||||
|
|
||||||
|
# TeamCity is a build add-in
|
||||||
|
_TeamCity*
|
||||||
|
|
||||||
|
# DotCover is a Code Coverage Tool
|
||||||
|
*.dotCover
|
||||||
|
|
||||||
|
# AxoCover is a Code Coverage Tool
|
||||||
|
.axoCover/*
|
||||||
|
!.axoCover/settings.json
|
||||||
|
|
||||||
|
# Coverlet is a free, cross platform Code Coverage Tool
|
||||||
|
coverage*.json
|
||||||
|
coverage*.xml
|
||||||
|
coverage*.info
|
||||||
|
|
||||||
|
# Visual Studio code coverage results
|
||||||
|
*.coverage
|
||||||
|
*.coveragexml
|
||||||
|
|
||||||
|
# NCrunch
|
||||||
|
_NCrunch_*
|
||||||
|
.*crunch*.local.xml
|
||||||
|
nCrunchTemp_*
|
||||||
|
|
||||||
|
# MightyMoose
|
||||||
|
*.mm.*
|
||||||
|
AutoTest.Net/
|
||||||
|
|
||||||
|
# Web workbench (sass)
|
||||||
|
.sass-cache/
|
||||||
|
|
||||||
|
# Installshield output folder
|
||||||
|
[Ee]xpress/
|
||||||
|
|
||||||
|
# DocProject is a documentation generator add-in
|
||||||
|
DocProject/buildhelp/
|
||||||
|
DocProject/Help/*.HxT
|
||||||
|
DocProject/Help/*.HxC
|
||||||
|
DocProject/Help/*.hhc
|
||||||
|
DocProject/Help/*.hhk
|
||||||
|
DocProject/Help/*.hhp
|
||||||
|
DocProject/Help/Html2
|
||||||
|
DocProject/Help/html
|
||||||
|
|
||||||
|
# Click-Once directory
|
||||||
|
publish/
|
||||||
|
|
||||||
|
# Publish Web Output
|
||||||
|
*.[Pp]ublish.xml
|
||||||
|
*.azurePubxml
|
||||||
|
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||||
|
# but database connection strings (with potential passwords) will be unencrypted
|
||||||
|
*.pubxml
|
||||||
|
*.publishproj
|
||||||
|
|
||||||
|
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||||
|
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||||
|
# in these scripts will be unencrypted
|
||||||
|
PublishScripts/
|
||||||
|
|
||||||
|
# NuGet Packages
|
||||||
|
*.nupkg
|
||||||
|
# NuGet Symbol Packages
|
||||||
|
*.snupkg
|
||||||
|
# The packages folder can be ignored because of Package Restore
|
||||||
|
**/[Pp]ackages/*
|
||||||
|
# except build/, which is used as an MSBuild target.
|
||||||
|
!**/[Pp]ackages/build/
|
||||||
|
# Uncomment if necessary however generally it will be regenerated when needed
|
||||||
|
#!**/[Pp]ackages/repositories.config
|
||||||
|
# NuGet v3's project.json files produces more ignorable files
|
||||||
|
*.nuget.props
|
||||||
|
*.nuget.targets
|
||||||
|
|
||||||
|
# Microsoft Azure Build Output
|
||||||
|
csx/
|
||||||
|
*.build.csdef
|
||||||
|
|
||||||
|
# Microsoft Azure Emulator
|
||||||
|
ecf/
|
||||||
|
rcf/
|
||||||
|
|
||||||
|
# Windows Store app package directories and files
|
||||||
|
AppPackages/
|
||||||
|
BundleArtifacts/
|
||||||
|
Package.StoreAssociation.xml
|
||||||
|
_pkginfo.txt
|
||||||
|
*.appx
|
||||||
|
*.appxbundle
|
||||||
|
*.appxupload
|
||||||
|
|
||||||
|
# Visual Studio cache files
|
||||||
|
# files ending in .cache can be ignored
|
||||||
|
*.[Cc]ache
|
||||||
|
# but keep track of directories ending in .cache
|
||||||
|
!?*.[Cc]ache/
|
||||||
|
|
||||||
|
# Others
|
||||||
|
ClientBin/
|
||||||
|
~$*
|
||||||
|
*~
|
||||||
|
*.dbmdl
|
||||||
|
*.dbproj.schemaview
|
||||||
|
*.jfm
|
||||||
|
*.pfx
|
||||||
|
*.publishsettings
|
||||||
|
orleans.codegen.cs
|
||||||
|
|
||||||
|
# Including strong name files can present a security risk
|
||||||
|
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||||
|
#*.snk
|
||||||
|
|
||||||
|
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||||
|
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||||
|
#bower_components/
|
||||||
|
|
||||||
|
# RIA/Silverlight projects
|
||||||
|
Generated_Code/
|
||||||
|
|
||||||
|
# Backup & report files from converting an old project file
|
||||||
|
# to a newer Visual Studio version. Backup files are not needed,
|
||||||
|
# because we have git ;-)
|
||||||
|
_UpgradeReport_Files/
|
||||||
|
Backup*/
|
||||||
|
UpgradeLog*.XML
|
||||||
|
UpgradeLog*.htm
|
||||||
|
ServiceFabricBackup/
|
||||||
|
*.rptproj.bak
|
||||||
|
|
||||||
|
# SQL Server files
|
||||||
|
*.mdf
|
||||||
|
*.ldf
|
||||||
|
*.ndf
|
||||||
|
|
||||||
|
# Business Intelligence projects
|
||||||
|
*.rdl.data
|
||||||
|
*.bim.layout
|
||||||
|
*.bim_*.settings
|
||||||
|
*.rptproj.rsuser
|
||||||
|
*- [Bb]ackup.rdl
|
||||||
|
*- [Bb]ackup ([0-9]).rdl
|
||||||
|
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||||
|
|
||||||
|
# Microsoft Fakes
|
||||||
|
FakesAssemblies/
|
||||||
|
|
||||||
|
# GhostDoc plugin setting file
|
||||||
|
*.GhostDoc.xml
|
||||||
|
|
||||||
|
# Node.js Tools for Visual Studio
|
||||||
|
.ntvs_analysis.dat
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# Visual Studio 6 build log
|
||||||
|
*.plg
|
||||||
|
|
||||||
|
# Visual Studio 6 workspace options file
|
||||||
|
*.opt
|
||||||
|
|
||||||
|
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||||
|
*.vbw
|
||||||
|
|
||||||
|
# Visual Studio LightSwitch build output
|
||||||
|
**/*.HTMLClient/GeneratedArtifacts
|
||||||
|
**/*.DesktopClient/GeneratedArtifacts
|
||||||
|
**/*.DesktopClient/ModelManifest.xml
|
||||||
|
**/*.Server/GeneratedArtifacts
|
||||||
|
**/*.Server/ModelManifest.xml
|
||||||
|
_Pvt_Extensions
|
||||||
|
|
||||||
|
# Paket dependency manager
|
||||||
|
.paket/paket.exe
|
||||||
|
paket-files/
|
||||||
|
|
||||||
|
# FAKE - F# Make
|
||||||
|
.fake/
|
||||||
|
|
||||||
|
# CodeRush personal settings
|
||||||
|
.cr/personal
|
||||||
|
|
||||||
|
# Python Tools for Visual Studio (PTVS)
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
|
||||||
|
# Cake - Uncomment if you are using it
|
||||||
|
# tools/**
|
||||||
|
# !tools/packages.config
|
||||||
|
|
||||||
|
# Tabs Studio
|
||||||
|
*.tss
|
||||||
|
|
||||||
|
# Telerik's JustMock configuration file
|
||||||
|
*.jmconfig
|
||||||
|
|
||||||
|
# BizTalk build output
|
||||||
|
*.btp.cs
|
||||||
|
*.btm.cs
|
||||||
|
*.odx.cs
|
||||||
|
*.xsd.cs
|
||||||
|
|
||||||
|
# OpenCover UI analysis results
|
||||||
|
OpenCover/
|
||||||
|
|
||||||
|
# Azure Stream Analytics local run output
|
||||||
|
ASALocalRun/
|
||||||
|
|
||||||
|
# MSBuild Binary and Structured Log
|
||||||
|
*.binlog
|
||||||
|
|
||||||
|
# NVidia Nsight GPU debugger configuration file
|
||||||
|
*.nvuser
|
||||||
|
|
||||||
|
# MFractors (Xamarin productivity tool) working folder
|
||||||
|
.mfractor/
|
||||||
|
|
||||||
|
# Local History for Visual Studio
|
||||||
|
.localhistory/
|
||||||
|
|
||||||
|
# BeatPulse healthcheck temp database
|
||||||
|
healthchecksdb
|
||||||
|
|
||||||
|
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||||
|
MigrationBackup/
|
||||||
|
|
||||||
|
# Ionide (cross platform F# VS Code tools) working folder
|
||||||
|
.ionide/
|
||||||
|
|
||||||
|
# Fody - auto-generated XML schema
|
||||||
|
FodyWeavers.xsd
|
||||||
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.
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.
|
After Width: | Height: | Size: 675 KiB |
@ -0,0 +1,29 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<appSettings>
|
||||||
|
<add key="tc_host" value="http://127.0.0.1:7001/tc"/>
|
||||||
|
<add key="log_status" value="on"/>
|
||||||
|
<add key="app_folder" value="Connor"/>
|
||||||
|
<add key="titles" value="CHINT-TITLE-A0;CHINT-TITLE-A1"/>
|
||||||
|
<add key="media_names" value="ISO_full_bleed_A0_(841.00_x_1189.00_MM);ISO_full_bleed_A0_(841.00_x_1189.00_MM)"/>
|
||||||
|
<add key="rotates" value="true;false"/>
|
||||||
|
<add key="attr_index" value="序号"/>
|
||||||
|
<add key="encoding" value="gb2312"/>
|
||||||
|
<add key="ClientSettingsProvider.ServiceUri" value=""/>
|
||||||
|
</appSettings>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2"/>
|
||||||
|
</startup>
|
||||||
|
<system.web>
|
||||||
|
<membership defaultProvider="ClientAuthenticationMembershipProvider">
|
||||||
|
<providers>
|
||||||
|
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri=""/>
|
||||||
|
</providers>
|
||||||
|
</membership>
|
||||||
|
<roleManager defaultProvider="ClientRoleProvider" enabled="true">
|
||||||
|
<providers>
|
||||||
|
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400"/>
|
||||||
|
</providers>
|
||||||
|
</roleManager>
|
||||||
|
</system.web>
|
||||||
|
</configuration>
|
||||||
@ -0,0 +1,127 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||||
|
<data name="logo_16" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\logo_16.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
<data name="rac_login_background" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\rac_login_background.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
||||||
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 491 KiB |
@ -0,0 +1,146 @@
|
|||||||
|
//==================================================
|
||||||
|
//
|
||||||
|
// Copyright 2020 Siemens Digital Industries Software
|
||||||
|
//
|
||||||
|
//==================================================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
using Teamcenter.Schemas.Soa._2006_03.Exceptions;
|
||||||
|
using Teamcenter.Soa;
|
||||||
|
using Teamcenter.Soa.Common;
|
||||||
|
using Teamcenter.Soa.Client;
|
||||||
|
using Teamcenter.Soa.Exceptions;
|
||||||
|
|
||||||
|
namespace Teamcenter.ClientX
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The CredentialManager is used by the Teamcenter Services framework to get the
|
||||||
|
* user's credentials when challanged 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-authenitcate. The framework will
|
||||||
|
* call one of the getCredentials methods (depending on circumstances) and will
|
||||||
|
* send the SessionService.login service request. Upon successfull completion of
|
||||||
|
* the login service request. The last service request (one that cuased the challange)
|
||||||
|
* 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 requried for re-authentication.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class AppXCredentialManager : 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 CredentialType
|
||||||
|
{
|
||||||
|
get { return SoaConstants.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
|
||||||
|
{
|
||||||
|
Console.WriteLine(e.Message);
|
||||||
|
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, shoult 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
|
||||||
|
{
|
||||||
|
Console.WriteLine("Please enter user credentials (return to quit):");
|
||||||
|
Console.Write("User Name: ");
|
||||||
|
name = Console.ReadLine();
|
||||||
|
|
||||||
|
if (name.Length == 0)
|
||||||
|
throw new CanceledOperationException("");
|
||||||
|
|
||||||
|
Console.Write("Password: ");
|
||||||
|
password = Console.ReadLine();
|
||||||
|
}
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
String message = "Failed to get the name and password.\n" + e.Message;
|
||||||
|
Console.WriteLine(message);
|
||||||
|
throw new CanceledOperationException(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] tokens = { name, password, group, role, discriminator };
|
||||||
|
return tokens;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,99 @@
|
|||||||
|
//==================================================
|
||||||
|
//
|
||||||
|
// Copyright 2020 Siemens Digital Industries Software
|
||||||
|
//
|
||||||
|
//==================================================
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
using Teamcenter.Schemas.Soa._2006_03.Exceptions;
|
||||||
|
using Teamcenter.Soa.Client;
|
||||||
|
using Teamcenter.Soa.Exceptions;
|
||||||
|
|
||||||
|
namespace Teamcenter.ClientX
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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 : ExceptionHandler
|
||||||
|
{
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see com.teamcenter.soa.client.ExceptionHandler#handleException(com.teamcenter.schemas.soa._2006_03.exceptions.InternalServerException)
|
||||||
|
*/
|
||||||
|
public void HandleException(InternalServerException ise)
|
||||||
|
{
|
||||||
|
Console.WriteLine("");
|
||||||
|
Console.WriteLine("*****");
|
||||||
|
Console.WriteLine("Exception caught in com.teamcenter.clientx.AppXExceptionHandler.handleException(InternalServerException).");
|
||||||
|
|
||||||
|
|
||||||
|
if (ise is 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).
|
||||||
|
throw new SystemException("\nThe server returned an connection error.\n" + ise.Message);
|
||||||
|
}
|
||||||
|
else if (ise is ProtocolException)
|
||||||
|
{
|
||||||
|
// ProtocolException are typically due to programming errors
|
||||||
|
// (content of HTTP
|
||||||
|
// request is incorrect). These are generally can not be
|
||||||
|
// recovered from.
|
||||||
|
throw new SystemException("\nThe server returned an protocol error.\n" + ise.Message
|
||||||
|
+ "\nThis is most likely the result of a programming error.");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.WriteLine("\nThe server returned an internal server error.\n"
|
||||||
|
+ ise.Message
|
||||||
|
+ "\nThis is most likely the result of a programming error."
|
||||||
|
+ "\nA RuntimeException will be thrown.");
|
||||||
|
throw new SystemException(ise.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
//try
|
||||||
|
//{
|
||||||
|
// String retry = Console.ReadLine();
|
||||||
|
// // If yes, return to the calling SOA client framework, where the
|
||||||
|
// // last service request will be resent.
|
||||||
|
// if (retry.ToLower().Equals("y") || retry.ToLower().Equals("yes"))
|
||||||
|
// return;
|
||||||
|
|
||||||
|
// throw new SystemException("The user has opted not to retry the last request");
|
||||||
|
//}
|
||||||
|
//catch (IOException e)
|
||||||
|
//{
|
||||||
|
// Console.Error.WriteLine("Failed to read user response.\nA RuntimeException will be thrown.");
|
||||||
|
// throw new SystemException(e.Message);
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see com.teamcenter.soa.client.ExceptionHandler#handleException(com.teamcenter.soa.exceptions.CanceledOperationException)
|
||||||
|
*/
|
||||||
|
public void HandleException(CanceledOperationException coe)
|
||||||
|
{
|
||||||
|
Console.WriteLine("");
|
||||||
|
Console.WriteLine("*****");
|
||||||
|
Console.WriteLine("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 SystemException(coe.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,65 @@
|
|||||||
|
//==================================================
|
||||||
|
//
|
||||||
|
// Copyright 2020 Siemens Digital Industries Software
|
||||||
|
//
|
||||||
|
//==================================================
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
using Teamcenter.Soa.Client.Model;
|
||||||
|
using Teamcenter.Soa.Exceptions;
|
||||||
|
|
||||||
|
namespace Teamcenter.ClientX
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implementation of the ChangeListener. Print out all objects that have been updated.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class AppXModelEventListener : ModelEventListener
|
||||||
|
{
|
||||||
|
|
||||||
|
override public void LocalObjectChange(ModelObject[] objects)
|
||||||
|
{
|
||||||
|
if (objects.Length == 0) return;
|
||||||
|
System.Console.WriteLine("");
|
||||||
|
System.Console.WriteLine("Modified Objects handled in com.teamcenter.clientx.AppXUpdateObjectListener.modelObjectChange");
|
||||||
|
System.Console.WriteLine("The following objects have been updated in the client data model:");
|
||||||
|
for (int i = 0; i < objects.Length; i++)
|
||||||
|
{
|
||||||
|
String uid = objects[i].Uid;
|
||||||
|
String type = objects[i].GetType().Name;
|
||||||
|
String name = "";
|
||||||
|
if (objects[i].GetType().Name.Equals("WorkspaceObject"))
|
||||||
|
{
|
||||||
|
ModelObject wo = objects[i];
|
||||||
|
try
|
||||||
|
{
|
||||||
|
name = wo.GetProperty("object_string").StringValue;
|
||||||
|
}
|
||||||
|
catch (NotLoadedException /*e*/) {} // just ignore
|
||||||
|
}
|
||||||
|
System.Console.WriteLine(" " + uid + " " + type + " " + name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
override public void LocalObjectDelete(string[] uids)
|
||||||
|
{
|
||||||
|
if (uids.Length == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
System.Console.WriteLine("");
|
||||||
|
System.Console.WriteLine("Deleted Objects handled in com.teamcenter.clientx.AppXDeletedObjectListener.modelObjectDelete");
|
||||||
|
System.Console.WriteLine("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.Console.WriteLine(" " + uids[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,68 @@
|
|||||||
|
//==================================================
|
||||||
|
//
|
||||||
|
// Copyright 2020 Siemens Digital Industries Software
|
||||||
|
//
|
||||||
|
//==================================================
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
using Teamcenter.Soa.Client.Model;
|
||||||
|
|
||||||
|
|
||||||
|
namespace Teamcenter.ClientX
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implementation of the PartialErrorListener. Print out any partial errors
|
||||||
|
* returned.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class AppXPartialErrorListener : PartialErrorListener
|
||||||
|
{
|
||||||
|
|
||||||
|
/*
|
||||||
|
* (non-Javadoc)
|
||||||
|
*
|
||||||
|
* @see com.teamcenter.soa.client.model.PartialErrorListener#handlePartialError(com.teamcenter.soa.client.model.ErrorStack[])
|
||||||
|
*/
|
||||||
|
public void HandlePartialError(ErrorStack[] stacks)
|
||||||
|
{
|
||||||
|
if (stacks.Length == 0) return;
|
||||||
|
|
||||||
|
Console.WriteLine("");
|
||||||
|
Console.WriteLine("*****");
|
||||||
|
Console.WriteLine("Partial Errors caught in com.teamcenter.clientx.AppXPartialErrorListener.");
|
||||||
|
|
||||||
|
|
||||||
|
for (int i = 0; i < stacks.Length; i++)
|
||||||
|
{
|
||||||
|
ErrorValue[] errors = stacks[i].ErrorValues;
|
||||||
|
Console.Write("Partial Error for ");
|
||||||
|
|
||||||
|
// The different service implementation may optionally associate
|
||||||
|
// an ModelObject, client ID, or nothing, with each partial error
|
||||||
|
if (stacks[i].HasAssociatedObject() )
|
||||||
|
{
|
||||||
|
Console.WriteLine("object "+ stacks[i].AssociatedObject.Uid);
|
||||||
|
}
|
||||||
|
else if (stacks[i].HasClientId())
|
||||||
|
{
|
||||||
|
Console.WriteLine("client id "+ stacks[i].ClientId);
|
||||||
|
}
|
||||||
|
else if (stacks[i].HasClientIndex())
|
||||||
|
{
|
||||||
|
Console.WriteLine("client index " + stacks[i].ClientIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Each Partial Error will have one or more contributing error messages
|
||||||
|
for (int j = 0; j < errors.Length; j++)
|
||||||
|
{
|
||||||
|
Console.WriteLine(" Code: " + errors[j].Code + "\tSeverity: "
|
||||||
|
+ errors[j].Level + "\t" + errors[j].Message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
//==================================================
|
||||||
|
//
|
||||||
|
// Copyright 2020 Siemens Digital Industries Software
|
||||||
|
//
|
||||||
|
//==================================================
|
||||||
|
|
||||||
|
using System;
|
||||||
|
|
||||||
|
using Teamcenter.Soa.Client;
|
||||||
|
|
||||||
|
|
||||||
|
namespace Teamcenter.ClientX
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This implemenation of the RequestListener, logs each service request
|
||||||
|
* to the console.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class AppXRequestListener : RequestListener
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called before each request is sent to the server.
|
||||||
|
*/
|
||||||
|
public void ServiceRequest(ServiceInfo 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(ServiceInfo info)
|
||||||
|
{
|
||||||
|
Console.WriteLine(info.Id + ": " + info.Service + "." + info.Operation);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,243 @@
|
|||||||
|
//==================================================
|
||||||
|
//
|
||||||
|
// Copyright 2020 Siemens Digital Industries Software
|
||||||
|
//
|
||||||
|
//==================================================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Net;
|
||||||
|
|
||||||
|
using Teamcenter.Schemas.Soa._2006_03.Exceptions;
|
||||||
|
using Teamcenter.Services.Strong.Core;
|
||||||
|
using Teamcenter.Services.Strong.Core._2006_03.Session;
|
||||||
|
using Teamcenter.Soa;
|
||||||
|
using Teamcenter.Soa.Client;
|
||||||
|
using Teamcenter.Soa.Client.Model;
|
||||||
|
using Teamcenter.Soa.Exceptions;
|
||||||
|
|
||||||
|
using WorkspaceObject = Teamcenter.Soa.Client.Model.Strong.WorkspaceObject;
|
||||||
|
using User = Teamcenter.Soa.Client.Model.Strong.User;
|
||||||
|
using connor_zwcadm.util;
|
||||||
|
|
||||||
|
namespace Teamcenter.ClientX {
|
||||||
|
|
||||||
|
|
||||||
|
public class Session {
|
||||||
|
/**
|
||||||
|
* Single instance of the Connection object that is shared throughtout
|
||||||
|
* 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 Session(String host) {
|
||||||
|
// Create an instance of the CredentialManager, this is used
|
||||||
|
// by the SOA Framework to get the user's credentials when
|
||||||
|
// challanged by the server (sesioin timeout on the web tier).
|
||||||
|
credentialManager = new AppXCredentialManager();
|
||||||
|
string proto = null;
|
||||||
|
string envNameTccs = null;
|
||||||
|
if (host.StartsWith("http")) {
|
||||||
|
proto = SoaConstants.HTTP;
|
||||||
|
}
|
||||||
|
else if (host.StartsWith("tccs")) {
|
||||||
|
proto = SoaConstants.TCCS;
|
||||||
|
int envNameStart = host.IndexOf('/') + 2;
|
||||||
|
envNameTccs = host.Substring(envNameStart, host.Length - envNameStart);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the Connection object, no contact is made with the server
|
||||||
|
// until a service request is made
|
||||||
|
connection = new Connection(host, new System.Net.CookieCollection(), credentialManager, SoaConstants.REST, proto, false);
|
||||||
|
if (proto == SoaConstants.TCCS)
|
||||||
|
connection.SetOption(Connection.TCCS_ENV_NAME, envNameTccs);
|
||||||
|
|
||||||
|
|
||||||
|
// Add an ExceptionHandler to the Connection, this will handle any
|
||||||
|
// InternalServerException, communication errors, xml marshalling errors
|
||||||
|
// .etc
|
||||||
|
connection.ExceptionHandler = 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.ModelManager.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.ModelManager.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 resp = sessionService.Login(credentials[0], credentials[1],
|
||||||
|
credentials[2], credentials[3], "", credentials[4]);
|
||||||
|
|
||||||
|
return resp.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;
|
||||||
|
}
|
||||||
|
|
||||||
|
public User login(string user, string password) {
|
||||||
|
// Get the service stub
|
||||||
|
SessionService sessionService = SessionService.getService(connection);
|
||||||
|
LoginResponse resp = sessionService.Login(user, password, "", "", "zh_CN", "SoaAppX");
|
||||||
|
TCUtil.CheckPartialError(resp.ServiceData);
|
||||||
|
return resp.User;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Terminate the session with the Teamcenter Server
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public static void logout() {
|
||||||
|
// Get the service stub
|
||||||
|
SessionService sessionService = SessionService.getService(connection);
|
||||||
|
try {
|
||||||
|
// *****************************
|
||||||
|
// Execute the service operation
|
||||||
|
// *****************************
|
||||||
|
sessionService.Logout();
|
||||||
|
connection = null;
|
||||||
|
}
|
||||||
|
catch (ServiceException /*e*/) { }
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Print some basic information for a list of objects
|
||||||
|
*
|
||||||
|
* @param objects
|
||||||
|
*/
|
||||||
|
public static void printObjects(ModelObject[] objects) {
|
||||||
|
if (objects == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
// Ensure that the referenced User objects that we will use below are loaded
|
||||||
|
getUsers(objects);
|
||||||
|
|
||||||
|
Console.WriteLine("Name\t\tOwner\t\tLast Modified");
|
||||||
|
Console.WriteLine("====\t\t=====\t\t=============");
|
||||||
|
for (int i = 0; i < objects.Length; i++) {
|
||||||
|
if (!(objects[i] is WorkspaceObject))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
WorkspaceObject wo = (WorkspaceObject)objects[i];
|
||||||
|
try {
|
||||||
|
String name = wo.Object_string;
|
||||||
|
User owner = (User)wo.Owning_user;
|
||||||
|
DateTime lastModified = wo.Last_mod_date;
|
||||||
|
|
||||||
|
Console.WriteLine(name + "\t" + owner.User_name + "\t" + lastModified.ToString());
|
||||||
|
}
|
||||||
|
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
|
||||||
|
Console.WriteLine(e.Message);
|
||||||
|
Console.WriteLine("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(Session.getConnection());
|
||||||
|
ArrayList unKnownUsers = new ArrayList();
|
||||||
|
for (int i = 0; i < objects.Length; i++) {
|
||||||
|
if (!(objects[i] is WorkspaceObject))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
WorkspaceObject wo = (WorkspaceObject)objects[i];
|
||||||
|
|
||||||
|
User owner = null;
|
||||||
|
try {
|
||||||
|
owner = (User)wo.Owning_user;
|
||||||
|
String userName = owner.User_name;
|
||||||
|
}
|
||||||
|
catch (NotLoadedException /*e*/) {
|
||||||
|
if (owner != null)
|
||||||
|
unKnownUsers.Add(owner);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
User[] users = new User[unKnownUsers.Count];
|
||||||
|
unKnownUsers.CopyTo(users);
|
||||||
|
String[] attributes = { "user_name" };
|
||||||
|
|
||||||
|
|
||||||
|
// *****************************
|
||||||
|
// Execute the service operation
|
||||||
|
// *****************************
|
||||||
|
dmService.GetProperties(users, attributes);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,114 @@
|
|||||||
|
<Window x:Class="connor_zwcadm.dialog.KProgressBar"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="clr-namespace:connor_zwcadm.dialog"
|
||||||
|
mc:Ignorable="d" Icon="/connor_zwcadm;component/Resources/logo_16.ico" Background="{x:Null}" Visibility="Visible" WindowStartupLocation="CenterOwner"
|
||||||
|
MouseDown="Window_MouseDown" Height="120" Width="370" FontFamily="Microsoft YaHei" Foreground="{x:Null}" TextOptions.TextFormattingMode="Display" AllowsTransparency="True" WindowStyle="None" ResizeMode="NoResize" Padding="0">
|
||||||
|
|
||||||
|
<Window.Resources>
|
||||||
|
<Style TargetType="{x:Type ProgressBar}">
|
||||||
|
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||||
|
<Setter Property="SnapsToDevicePixels" Value="True"/>
|
||||||
|
<Setter Property="Height" Value="15"/>
|
||||||
|
<Setter Property="Background" Value="#1BA1E2"/>
|
||||||
|
<Setter Property="FontSize" Value="10"/>
|
||||||
|
<Setter Property="Padding" Value="5,0"/>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="{x:Type ProgressBar}">
|
||||||
|
<Grid Background="#00000000">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<VisualStateManager.VisualStateGroups>
|
||||||
|
<VisualStateGroup x:Name="CommonStates">
|
||||||
|
<VisualState x:Name="Determinate"/>
|
||||||
|
<VisualState x:Name="Indeterminate">
|
||||||
|
<Storyboard RepeatBehavior="Forever">
|
||||||
|
<PointAnimationUsingKeyFrames Storyboard.TargetName="Animation" Storyboard.TargetProperty="(UIElement.RenderTransformOrigin)">
|
||||||
|
<EasingPointKeyFrame KeyTime="0:0:0" Value="0.5,0.5"/>
|
||||||
|
<EasingPointKeyFrame KeyTime="0:0:1.5" Value="1.95,0.5"/>
|
||||||
|
<EasingPointKeyFrame KeyTime="0:0:3" Value="0.5,0.5"/>
|
||||||
|
</PointAnimationUsingKeyFrames>
|
||||||
|
</Storyboard>
|
||||||
|
</VisualState>
|
||||||
|
</VisualStateGroup>
|
||||||
|
</VisualStateManager.VisualStateGroups>
|
||||||
|
|
||||||
|
<Grid Height="{TemplateBinding Height}">
|
||||||
|
<Border Background="#000000" CornerRadius="7.5" Opacity="0.05"/>
|
||||||
|
<Border BorderBrush="#000000" BorderThickness="1" CornerRadius="7.5" Opacity="0.1"/>
|
||||||
|
<Grid Margin="{TemplateBinding BorderThickness}">
|
||||||
|
<Border x:Name="PART_Track"/>
|
||||||
|
<Grid x:Name="PART_Indicator" ClipToBounds="True" HorizontalAlignment="Left" >
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition x:Name="width1"/>
|
||||||
|
<ColumnDefinition x:Name="width2" Width="0"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid x:Name="Animation" RenderTransformOrigin="0.5,0.5">
|
||||||
|
<Grid.RenderTransform>
|
||||||
|
<TransformGroup>
|
||||||
|
<ScaleTransform ScaleY="-1" ScaleX="1"/>
|
||||||
|
<SkewTransform AngleY="0" AngleX="0"/>
|
||||||
|
<RotateTransform Angle="180"/>
|
||||||
|
<TranslateTransform/>
|
||||||
|
</TransformGroup>
|
||||||
|
</Grid.RenderTransform>
|
||||||
|
<Border Background="{TemplateBinding Background}" CornerRadius="7.5">
|
||||||
|
<Viewbox HorizontalAlignment="Left" StretchDirection="DownOnly" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="True">
|
||||||
|
<TextBlock Visibility="Hidden" Foreground="#FFF" SnapsToDevicePixels="True" FontSize="{TemplateBinding FontSize}" VerticalAlignment="Center" Text="{Binding RelativeSource={RelativeSource TemplatedParent},Path=Value,StringFormat={}{0}%}" RenderTransformOrigin="0.5,0.5">
|
||||||
|
<TextBlock.RenderTransform>
|
||||||
|
<TransformGroup>
|
||||||
|
<ScaleTransform ScaleY="1" ScaleX="-1"/>
|
||||||
|
<SkewTransform AngleY="0" AngleX="0"/>
|
||||||
|
<RotateTransform Angle="0"/>
|
||||||
|
<TranslateTransform/>
|
||||||
|
</TransformGroup>
|
||||||
|
</TextBlock.RenderTransform>
|
||||||
|
</TextBlock>
|
||||||
|
</Viewbox>
|
||||||
|
</Border>
|
||||||
|
<Border BorderBrush="#000000" BorderThickness="1" CornerRadius="7.5" Opacity="0.1"/>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
|
||||||
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
|
<Setter Property="Background" Value="#c5c5c5"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsIndeterminate" Value="true">
|
||||||
|
<Setter TargetName="width1" Property="Width" Value="0.25*"/>
|
||||||
|
<Setter TargetName="width2" Property="Width" Value="0.725*"/>
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
</Window.Resources>
|
||||||
|
<Grid Margin="0,0,-2,-2">
|
||||||
|
<Rectangle Fill="#FFFBFBFB" RadiusX="8" RadiusY="8" Margin="10,10,10,10">
|
||||||
|
<Rectangle.Effect>
|
||||||
|
<DropShadowEffect BlurRadius="10" ShadowDepth="-5" Opacity="0.8" Direction="0" Color="#FF303030"/>
|
||||||
|
</Rectangle.Effect>
|
||||||
|
</Rectangle>
|
||||||
|
<Label Name="l_MainProgress" Content="正在执行:" HorizontalAlignment="Left" Margin="30,28,0,0" VerticalAlignment="Top"/>
|
||||||
|
<Label Name="l_SubProcess" Content="" HorizontalAlignment="Left" Margin="30,0,0,23" VerticalAlignment="Bottom"/>
|
||||||
|
<Grid Margin="33,10,33,0" Height="18" VerticalAlignment="Center">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<ProgressBar Grid.Column="0" Name="progressBar" IsIndeterminate="False" Value="0" HorizontalAlignment="Stretch" Height="18" VerticalAlignment="Center" />
|
||||||
|
<TextBlock Grid.Column="1" x:Name="tb_cancel" HorizontalAlignment="Center" TextAlignment="Center" TextWrapping="NoWrap" Width="30" VerticalAlignment="Center">
|
||||||
|
<Hyperlink Click="CancelWork">取消</Hyperlink>
|
||||||
|
</TextBlock>
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
<Window x:Name="登录" x:Class="connor_zwcadm.dialog.Login"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:local="clr-namespace:connor_zwcadm.dialog"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="450" d:DesignWidth="800"
|
||||||
|
Icon="/connor_zwcadm;component/Resources/logo_16.ico"
|
||||||
|
Background="{x:Null}"
|
||||||
|
Title="登录"
|
||||||
|
Visibility="Visible"
|
||||||
|
WindowStartupLocation="CenterOwner"
|
||||||
|
MouseDown="Window_MouseDown" Height="290" Width="720" FontFamily="Microsoft YaHei" Foreground="{x:Null}" TextOptions.TextFormattingMode="Display" AllowsTransparency="True" WindowStyle="None" ResizeMode="NoResize" Padding="0"
|
||||||
|
>
|
||||||
|
<Grid Margin="0,0,-2,-2">
|
||||||
|
<Rectangle Fill="#FFFBFBFB" RadiusX="8" RadiusY="8" Margin="10,10,10,10">
|
||||||
|
<Rectangle.Effect>
|
||||||
|
<DropShadowEffect BlurRadius="10" ShadowDepth="-5" Opacity="0.8" Direction="0" Color="#FF303030"/>
|
||||||
|
</Rectangle.Effect>
|
||||||
|
|
||||||
|
</Rectangle>
|
||||||
|
<Border CornerRadius="6, 0, 0, 6" HorizontalAlignment="Left" Margin="10,10,0,10" Width="442">
|
||||||
|
<Border.Background>
|
||||||
|
<ImageBrush Stretch="UniformToFill" ImageSource="/connor_zwcadm;component/Resources/rac_login_background.png"/>
|
||||||
|
</Border.Background>
|
||||||
|
</Border>
|
||||||
|
<Label Content="用户名" HorizontalAlignment="Right" Margin="0,83,200,0" VerticalAlignment="Top"/>
|
||||||
|
<Label Content="密 码" HorizontalAlignment="Right" Margin="0,140,200,0" VerticalAlignment="Top"/>
|
||||||
|
<!--<Label Content="角 色" HorizontalAlignment="Left" Margin="48,147,0,0" VerticalAlignment="Top"/>-->
|
||||||
|
<TextBox Name="tb_UserName" HorizontalAlignment="Right" Height="27" Margin="0,80,40,0" VerticalAlignment="Top" Width="150" BorderThickness="0,0,0,1" VerticalContentAlignment="Bottom" ToolTip="" Background="#FFFBFBFB"/>
|
||||||
|
<PasswordBox Name="tb_Password" HorizontalAlignment="Right" Height="27" Margin="0,137,40,0" VerticalAlignment="Top" Width="150" VerticalContentAlignment="Bottom" BorderThickness="0,0,0,1" Background="#FFFBFBFB"/>
|
||||||
|
|
||||||
|
<Button x:Name="b_Login" Content="登录" HorizontalAlignment="Right" Margin="0,214,150,0" VerticalAlignment="Top" Width="75" Height="24" IsDefault="True" Click="DoLogin"/>
|
||||||
|
<Rectangle Name="rec_Logout" Fill="#FFFBFBFB" RadiusX="8" RadiusY="8" Margin="460,10,10,10" Visibility="Hidden"/>
|
||||||
|
<Button x:Name="b_Close" Content="关闭" HorizontalAlignment="Right" Margin="0,214,50,0" VerticalAlignment="Top" Width="75" Height="24" Click="Button_Click_1" IsCancel="True"/>
|
||||||
|
<Button Name="b_Logout" Content="注销" HorizontalAlignment="Right" Margin="0,214,150,0" VerticalAlignment="Top" Width="75" Height="24" Click="DoLogout" Visibility="Hidden"/>
|
||||||
|
<Label Name="l_UserName" Content="" HorizontalAlignment="Center" Margin="440,120,0,0" VerticalAlignment="Top" Visibility="Hidden"/>
|
||||||
|
|
||||||
|
<!--<Image HorizontalAlignment="Left" Margin="10,10,0,10" Source="/connor_zwcad;component/Resources/rac_login_background.png"/>-->
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
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.
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.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue