Merge remote-tracking branch 'alfresco-repository/support/HF/6.56.15.N' into release/6.0.1
32
repository/.externalToolBuilders/JibX.launch
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
|
||||
<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="true"/>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
|
||||
<listEntry value="/Repository/build.xml"/>
|
||||
</listAttribute>
|
||||
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
|
||||
<listEntry value="1"/>
|
||||
</listAttribute>
|
||||
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
|
||||
<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
|
||||
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.ant.ui.classpathentry.antHome"> <memento default="true"/> </runtimeClasspathEntry> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry id="org.eclipse.ant.ui.classpathentry.extraClasspathEntries"> <memento/> </runtimeClasspathEntry> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/3rd Party/lib/jibx-run-1.2.5.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/3rd Party/lib/jibx-bind-1.2.5.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/3rd Party/lib/bcel.jar" path="3" type="2"/> "/>
|
||||
<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry internalArchive="/3rd Party/lib/xpp3-1.1.3_8.jar" path="3" type="2"/> "/>
|
||||
</listAttribute>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
|
||||
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.ui.antsupport.InternalAntRunner"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="Repository"/>
|
||||
<stringAttribute key="org.eclipse.jdt.launching.WORKING_DIRECTORY" value="${workspace_loc:Repository}"/>
|
||||
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_BUILD_SCOPE" value="${working_set:<?xml version="1.0" encoding="UTF-8"?> <launchConfigurationWorkingSet editPageId="org.eclipse.ui.resourceWorkingSetPage" factoryID="org.eclipse.ui.internal.WorkingSetFactory" id="1264001019976_1" label="workingSet" name="workingSet"> <item factoryID="org.eclipse.ui.internal.model.ResourceFactory" path="/Repository/source/java/org/alfresco/repo/dictionary" type="2"/> </launchConfigurationWorkingSet>}"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/Repository/build.xml}"/>
|
||||
<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,clean"/>
|
||||
<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
|
||||
<stringAttribute key="process_factory_id" value="org.eclipse.ant.ui.remoteAntProcessFactory"/>
|
||||
</launchConfiguration>
|
4
repository/.gitbugtraq
Normal file
@@ -0,0 +1,4 @@
|
||||
# For SmartGit
|
||||
[bugtraq "jira"]
|
||||
url = https://issues.alfresco.com/jira/browse/%BUGID%
|
||||
logRegex = ([A-Z]+-\\d+)
|
37
repository/.gitignore
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
*.class
|
||||
|
||||
# Eclipse
|
||||
.classpath
|
||||
.settings
|
||||
.project
|
||||
|
||||
# Intellij
|
||||
.idea/
|
||||
*.iml
|
||||
*.iws
|
||||
|
||||
# Mac
|
||||
.DS_Store
|
||||
|
||||
# Maven
|
||||
target
|
||||
*.log
|
||||
*.log.*
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
|
||||
.mtj
|
||||
.tmp/
|
||||
|
||||
# Package Files #
|
||||
|
||||
*.jar
|
||||
*.war
|
||||
*.ear
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
|
||||
hs_err_pid*
|
||||
alf_data
|
||||
/src/main/resources/alfresco-global.properties
|
||||
/src/main/resources/alfresco/extension/custom-log4j.properties
|
10
repository/.travis.settings.xml
Normal file
@@ -0,0 +1,10 @@
|
||||
<settings>
|
||||
<!-- required to push artifacts to repositories -->
|
||||
<servers>
|
||||
<server>
|
||||
<id>alfresco-public</id>
|
||||
<username>${env.MAVEN_USERNAME}</username>
|
||||
<password>${env.MAVEN_PASSWORD}</password>
|
||||
</server>
|
||||
</servers>
|
||||
</settings>
|
104
repository/.travis.yml
Normal file
@@ -0,0 +1,104 @@
|
||||
dist: xenial
|
||||
sudo: required
|
||||
language: java
|
||||
jdk:
|
||||
- openjdk11
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.m2
|
||||
# the cache can grow constantly
|
||||
before_cache:
|
||||
- rm -rf $HOME/.m2/repository/org/alfresco/alfresco-repository
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- /support\/.*/
|
||||
|
||||
stages:
|
||||
- test
|
||||
- release
|
||||
|
||||
install: travis_retry mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- stage: test
|
||||
name: "AllUnitTestsSuite"
|
||||
script: mvn test -B -Dtest=AllUnitTestsSuite
|
||||
- name: "WhiteSource scan"
|
||||
# only on support branches or master and if it is not a PR
|
||||
if: fork = false AND (branch = master OR branch =~ /support\/SP\/.*/) AND type != pull_request
|
||||
script:
|
||||
# Download the latest version of WhiteSource Unified Agent
|
||||
- curl -LJO https://github.com/whitesource/unified-agent-distribution/raw/master/standAlone/wss-unified-agent.jar
|
||||
# Run WhiteSource Unified Agent
|
||||
- java -jar wss-unified-agent.jar -apiKey ${WHITESOURCE_API_KEY} -c .wss-unified-agent.config
|
||||
- name: "AppContext01TestSuite"
|
||||
before_install:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:10.1 postgres -c 'max_connections=300'
|
||||
script: travis_wait 20 mvn test -B -Dtest=AppContext01TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
- name: "AppContext02TestSuite"
|
||||
before_install:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:10.1 postgres -c 'max_connections=300'
|
||||
script: travis_wait 20 mvn test -B -Dtest=AppContext02TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
- name: "AppContext03TestSuite"
|
||||
before_install:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:10.1 postgres -c 'max_connections=300'
|
||||
script: travis_wait 20 mvn test -B -Dtest=AppContext03TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
- name: "AppContext04TestSuite"
|
||||
before_install:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:10.1 postgres -c 'max_connections=300'
|
||||
script: travis_wait 20 mvn test -B -Dtest=AppContext04TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
- name: "AppContext05TestSuite"
|
||||
before_install:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:10.1 postgres -c 'max_connections=300'
|
||||
script: travis_wait 20 mvn test -B -Dtest=AppContext05TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
- name: "AppContext06TestSuite"
|
||||
before_install:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:10.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-pdf-renderer:1.3
|
||||
- docker run -d -p 8091:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-imagemagick:1.3
|
||||
- docker run -d -p 8092:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-libreoffice:1.3
|
||||
- docker run -d -p 8093:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-tika:1.3
|
||||
script: travis_wait 20 mvn test -B -Dtest=AppContext06TestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco -Dalfresco-pdf-renderer.url=http://localhost:8090/ -Djodconverter.url=http://localhost:8092/ -Dimg.url=http://localhost:8091/ -Dtika.url=http://localhost:8093/
|
||||
- name: "AppContextExtraTestSuite"
|
||||
before_install:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:10.1 postgres -c 'max_connections=300'
|
||||
script: travis_wait 20 mvn test -B -Dtest=AppContextExtraTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
- name: "MiscContextTestSuite"
|
||||
before_install:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:10.1 postgres -c 'max_connections=300'
|
||||
- docker run -d -p 8090:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-pdf-renderer:1.3
|
||||
- docker run -d -p 8091:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-imagemagick:1.3
|
||||
- docker run -d -p 8092:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-libreoffice:1.3
|
||||
- docker run -d -p 8093:8090 -e JAVA_OPTS=" -Xms256m -Xmx256m" alfresco/alfresco-tika:1.3
|
||||
script: travis_wait 20 mvn test -B -Dtest=MiscContextTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco -Dalfresco-pdf-renderer.url=http://localhost:8090/ -Djodconverter.url=http://localhost:8092/ -Dimg.url=http://localhost:8091/ -Dtika.url=http://localhost:8093/
|
||||
- name: "MySQL tests"
|
||||
before_install:
|
||||
- docker run -d -p 3307:3306 -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mysql:5.7.23 --transaction-isolation='READ-COMMITTED'
|
||||
script: travis_wait 20 mvn test -B -Dtest=AllDBTestsTestSuite -Ddb.driver=com.mysql.jdbc.Driver -Ddb.name=alfresco -Ddb.url=jdbc:mysql://localhost:3307/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
- name: "PostgreSQL tests"
|
||||
before_install:
|
||||
- docker run -d -p 5433:5432 -e POSTGRES_PASSWORD=alfresco -e POSTGRES_USER=alfresco -e POSTGRES_DB=alfresco postgres:10.1 postgres -c 'max_connections=300'
|
||||
script: travis_wait 20 mvn test -B -Dtest=AllDBTestsTestSuite -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql://localhost:5433/alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
- name: "MariaDB tests"
|
||||
before_install:
|
||||
- docker run -d -p 3307:3306 --name mariadb -e MYSQL_ROOT_PASSWORD=alfresco -e MYSQL_USER=alfresco -e MYSQL_DATABASE=alfresco -e MYSQL_PASSWORD=alfresco mariadb:10.2.18 --transaction-isolation=READ-COMMITTED --max-connections=300 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
|
||||
script: travis_wait 20 mvn test -B -Dtest=AllDBTestsTestSuite -Ddb.name=alfresco -Ddb.url=jdbc:mariadb://localhost:3307/alfresco?useUnicode=yes\&characterEncoding=UTF-8 -Ddb.username=alfresco -Ddb.password=alfresco -Ddb.driver=org.mariadb.jdbc.Driver
|
||||
- stage: release
|
||||
name: "Push to Nexus"
|
||||
if: fork = false AND (branch = master OR branch =~ /support\/.*/) AND type != pull_request AND commit_message !~ /\[no-release\]/
|
||||
before_install:
|
||||
- "cp .travis.settings.xml $HOME/.m2/settings.xml"
|
||||
script:
|
||||
# Use full history for release
|
||||
- git checkout -B "${TRAVIS_BRANCH}"
|
||||
# Add email to link commits to user
|
||||
- git config user.email "${GIT_EMAIL}"
|
||||
# Skip building of release commits
|
||||
- mvn --batch-mode -q -DscmCommentPrefix="[maven-release-plugin][skip ci] " -Dusername="${GIT_USERNAME}" -Dpassword="${GIT_PASSWORD}" -DskipTests -Darguments=-DskipTests release:clean release:prepare release:perform
|
228
repository/.wss-unified-agent.config
Normal file
@@ -0,0 +1,228 @@
|
||||
####################################################################
|
||||
# WhiteSource Unified-Agent configuration file
|
||||
####################################################################
|
||||
##########################################
|
||||
# GENERAL SCAN MODE: Files and Package Managers
|
||||
##########################################
|
||||
|
||||
checkPolicies=true
|
||||
forceCheckAllDependencies=true
|
||||
forceUpdate=true
|
||||
forceUpdate.failBuildOnPolicyViolation=true
|
||||
offline=false
|
||||
#ignoreSourceFiles=true
|
||||
#scanComment=
|
||||
#updateInventory=false
|
||||
#resolveAllDependencies=false
|
||||
#failErrorLevel=ALL
|
||||
#requireKnownSha1=false
|
||||
#generateScanReport=true
|
||||
#scanReportTimeoutMinutes=10
|
||||
#excludeDependenciesFromNodes=.*commons-io.*,.*maven-model
|
||||
|
||||
#projectPerFolder=true
|
||||
#projectPerFolderIncludes=
|
||||
#projectPerFolderExcludes=
|
||||
|
||||
#wss.connectionTimeoutMinutes=60
|
||||
# Change the below URL to your WhiteSource server.
|
||||
# Use the 'WhiteSource Server URL' which can be retrieved
|
||||
# from your 'Profile' page on the 'Server URLs' panel.
|
||||
# Then, add the '/agent' path to it.
|
||||
wss.url=https://saas.whitesourcesoftware.com/agent
|
||||
|
||||
#npm.resolveDependencies=false
|
||||
#npm.ignoreSourceFiles=false
|
||||
#npm.includeDevDependencies=true
|
||||
#npm.runPreStep=true
|
||||
#npm.ignoreNpmLsErrors=true
|
||||
#npm.ignoreScripts=true
|
||||
#npm.yarnProject=true
|
||||
#npm.accessToken=
|
||||
#npm.identifyByNameAndVersion=true
|
||||
|
||||
#bower.resolveDependencies=false
|
||||
#bower.ignoreSourceFiles=true
|
||||
#bower.runPreStep=true
|
||||
|
||||
#nuget.resolvePackagesConfigFiles=false
|
||||
#nuget.resolveCsProjFiles=false
|
||||
#nuget.resolveDependencies=false
|
||||
#nuget.restoreDependencies=true
|
||||
#nuget.ignoreSourceFiles=true
|
||||
#nuget.runPreStep=true
|
||||
#nuget.resolveNuspecFiles=false
|
||||
|
||||
#python.resolveDependencies=false
|
||||
#python.ignoreSourceFiles=false
|
||||
#python.ignorePipInstallErrors=true
|
||||
#python.installVirtualenv=true
|
||||
#python.resolveHierarchyTree=false
|
||||
#python.requirementsFileIncludes=requirements.txt
|
||||
#python.resolveSetupPyFiles=true
|
||||
#python.runPipenvPreStep=true
|
||||
#python.pipenvDevDependencies=true
|
||||
#python.IgnorePipenvInstallErrors=true
|
||||
|
||||
#maven.ignoredScopes=test provided
|
||||
maven.resolveDependencies=true
|
||||
#maven.ignoreSourceFiles=true
|
||||
#maven.aggregateModules=true
|
||||
maven.ignorePomModules=false
|
||||
#maven.runPreStep=true
|
||||
#maven.ignoreMvnTreeErrors=true
|
||||
#maven.environmentPath=
|
||||
#maven.m2RepositoryPath=
|
||||
|
||||
#gradle.ignoredScopes=
|
||||
#gradle.resolveDependencies=false
|
||||
#gradle.runAssembleCommand=false
|
||||
#gradle.runPreStep=true
|
||||
#gradle.ignoreSourceFiles=true
|
||||
#gradle.aggregateModules=true
|
||||
#gradle.preferredEnvironment=wrapper
|
||||
#gradle.localRepositoryPath=
|
||||
|
||||
#paket.resolveDependencies=false
|
||||
#paket.ignoredGroups=
|
||||
#paket.ignoreSourceFiles=false
|
||||
#paket.runPreStep=true
|
||||
#paket.exePath=
|
||||
|
||||
#go.resolveDependencies=false
|
||||
#go.collectDependenciesAtRuntime=true
|
||||
#go.dependencyManager=
|
||||
#go.ignoreSourceFiles=true
|
||||
#go.glide.ignoreTestPackages=false
|
||||
#go.gogradle.enableTaskAlias=true
|
||||
|
||||
#ruby.resolveDependencies = false
|
||||
#ruby.ignoreSourceFiles = false
|
||||
#ruby.installMissingGems = true
|
||||
#ruby.runBundleInstall = true
|
||||
#ruby.overwriteGemFile = true
|
||||
|
||||
#sbt.resolveDependencies=false
|
||||
#sbt.ignoreSourceFiles=true
|
||||
#sbt.aggregateModules=true
|
||||
#sbt.runPreStep=true
|
||||
#sbt.targetFolder=
|
||||
|
||||
#php.resolveDependencies=false
|
||||
#php.runPreStep=true
|
||||
#php.includeDevDependencies=true
|
||||
|
||||
#html.resolveDependencies=false
|
||||
|
||||
#cocoapods.resolveDependencies=false
|
||||
#cocoapods.runPreStep=true
|
||||
#cocoapods.ignoreSourceFiles=false
|
||||
|
||||
#hex.resolveDependencies=false
|
||||
#hex.runPreStep=true
|
||||
#hex.ignoreSourceFiles=false
|
||||
#hex.aggregateModules=true
|
||||
|
||||
##################################
|
||||
# Organization tokens:
|
||||
##################################
|
||||
apiKey=
|
||||
|
||||
#userKey is required if WhiteSource administrator has enabled "Enforce user level access" option
|
||||
#userKey=
|
||||
|
||||
projectName=alfresco-repository
|
||||
projectVersion=6.56.15.N
|
||||
projectToken=
|
||||
|
||||
productName=ACS Community
|
||||
productVersion=
|
||||
productToken=
|
||||
#updateType=APPEND
|
||||
#requesterEmail=user@provider.com
|
||||
|
||||
#########################################################################################
|
||||
# Includes/Excludes Glob patterns - PLEASE USE ONLY ONE EXCLUDE LINE AND ONE INCLUDE LINE
|
||||
#########################################################################################
|
||||
#includes=**/*.c **/*.cc **/*.cp **/*.cpp **/*.cxx **/*.c++ **/*.h **/*.hpp **/*.hxx
|
||||
|
||||
#includes=**/*.m **/*.mm **/*.js **/*.php
|
||||
includes=**/*.jar
|
||||
#includes=**/*.gem **/*.rb
|
||||
#includes=**/*.dll **/*.cs **/*.nupkg
|
||||
#includes=**/*.tgz **/*.deb **/*.gzip **/*.rpm **/*.tar.bz2
|
||||
#includes=**/*.zip **/*.tar.gz **/*.egg **/*.whl **/*.py
|
||||
|
||||
## Exclude file extensions or specific directories by adding **/*.<extension> or **<excluded_dir>/**
|
||||
excludes=**/*sources.jar **/*javadoc.jar
|
||||
|
||||
case.sensitive.glob=false
|
||||
followSymbolicLinks=true
|
||||
|
||||
##################################
|
||||
# Archive properties
|
||||
##################################
|
||||
#archiveExtractionDepth=2
|
||||
#archiveIncludes=**/*.war **/*.ear
|
||||
#archiveExcludes=**/*sources.jar
|
||||
|
||||
##################################
|
||||
# Proxy settings
|
||||
##################################
|
||||
#proxy.host=
|
||||
#proxy.port=
|
||||
#proxy.user=
|
||||
#proxy.pass=
|
||||
|
||||
##################################
|
||||
# SCM settings
|
||||
##################################
|
||||
#scm.type=
|
||||
#scm.user=
|
||||
#scm.pass=
|
||||
#scm.ppk=
|
||||
#scm.url=
|
||||
#scm.branch=
|
||||
#scm.tag=
|
||||
#scm.npmInstall=
|
||||
#scm.npmInstallTimeoutMinutes=
|
||||
#scm.repositoriesFile=
|
||||
|
||||
##############################################
|
||||
# SCAN MODE: Linux package manager settings
|
||||
##############################################
|
||||
#scanPackageManager=true
|
||||
|
||||
##################################
|
||||
# SCAN MODE: Docker images
|
||||
##################################
|
||||
#docker.scanImages=true
|
||||
#docker.includes=.*.*
|
||||
#docker.excludes=
|
||||
#docker.pull.enable=true
|
||||
#docker.pull.images=.*.*
|
||||
#docker.pull.maxImages=10
|
||||
#docker.pull.tags=.*.*
|
||||
#docker.pull.digest=
|
||||
#docker.delete.force=true
|
||||
#docker.login.sudo=false
|
||||
|
||||
#docker.aws.enable=true
|
||||
#docker.aws.registryIds=
|
||||
|
||||
##################################
|
||||
# SCAN MODE: Docker containers
|
||||
##################################
|
||||
#docker.scanContainers=true
|
||||
#docker.containerIncludes=.*.*
|
||||
#docker.containerExcludes=
|
||||
|
||||
################################
|
||||
# Serverless settings
|
||||
################################
|
||||
#serverless.provider=
|
||||
#serverless.scanFunctions=true
|
||||
#serverless.includes=
|
||||
#serverless.excludes=
|
||||
#serverless.region=
|
||||
#serverless.maxFunctions=10
|
16
repository/CONTRIBUTING.md
Normal file
@@ -0,0 +1,16 @@
|
||||
### Contributing
|
||||
Thanks for your interest in contributing to this project!
|
||||
|
||||
The following is a set of guidelines for contributing to this library. Most of them will make the life of the reviewer easier and therefore decrease the time required for the patch be included in the next version.
|
||||
|
||||
Because this project forms a part of Alfresco Content Services, the guidelines are hosted in the [Alfresco Social Community](http://community.alfresco.com/community/ecm) where they can be referenced from multiple projects.
|
||||
|
||||
Read an [overview on how this project is goverened](https://community.alfresco.com/docs/DOC-6385-project-overview-repository).
|
||||
|
||||
You can report an issue in the ALF project of the [Alfresco issue tracker](http://issues.alfresco.com).
|
||||
|
||||
Read [instructions for a good issue report](https://community.alfresco.com/docs/DOC-6263-reporting-an-issue).
|
||||
|
||||
Read [instructions for making a contribution](https://community.alfresco.com/docs/DOC-6269-submitting-contributions).
|
||||
|
||||
Please follow [the coding standards](https://community.alfresco.com/docs/DOC-4658-coding-standards).
|
165
repository/LICENSE
Normal file
@@ -0,0 +1,165 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
This version of the GNU Lesser General Public License incorporates
|
||||
the terms and conditions of version 3 of the GNU General Public
|
||||
License, supplemented by the additional permissions listed below.
|
||||
|
||||
0. Additional Definitions.
|
||||
|
||||
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||
General Public License.
|
||||
|
||||
"The Library" refers to a covered work governed by this License,
|
||||
other than an Application or a Combined Work as defined below.
|
||||
|
||||
An "Application" is any work that makes use of an interface provided
|
||||
by the Library, but which is not otherwise based on the Library.
|
||||
Defining a subclass of a class defined by the Library is deemed a mode
|
||||
of using an interface provided by the Library.
|
||||
|
||||
A "Combined Work" is a work produced by combining or linking an
|
||||
Application with the Library. The particular version of the Library
|
||||
with which the Combined Work was made is also called the "Linked
|
||||
Version".
|
||||
|
||||
The "Minimal Corresponding Source" for a Combined Work means the
|
||||
Corresponding Source for the Combined Work, excluding any source code
|
||||
for portions of the Combined Work that, considered in isolation, are
|
||||
based on the Application, and not on the Linked Version.
|
||||
|
||||
The "Corresponding Application Code" for a Combined Work means the
|
||||
object code and/or source code for the Application, including any data
|
||||
and utility programs needed for reproducing the Combined Work from the
|
||||
Application, but excluding the System Libraries of the Combined Work.
|
||||
|
||||
1. Exception to Section 3 of the GNU GPL.
|
||||
|
||||
You may convey a covered work under sections 3 and 4 of this License
|
||||
without being bound by section 3 of the GNU GPL.
|
||||
|
||||
2. Conveying Modified Versions.
|
||||
|
||||
If you modify a copy of the Library, and, in your modifications, a
|
||||
facility refers to a function or data to be supplied by an Application
|
||||
that uses the facility (other than as an argument passed when the
|
||||
facility is invoked), then you may convey a copy of the modified
|
||||
version:
|
||||
|
||||
a) under this License, provided that you make a good faith effort to
|
||||
ensure that, in the event an Application does not supply the
|
||||
function or data, the facility still operates, and performs
|
||||
whatever part of its purpose remains meaningful, or
|
||||
|
||||
b) under the GNU GPL, with none of the additional permissions of
|
||||
this License applicable to that copy.
|
||||
|
||||
3. Object Code Incorporating Material from Library Header Files.
|
||||
|
||||
The object code form of an Application may incorporate material from
|
||||
a header file that is part of the Library. You may convey such object
|
||||
code under terms of your choice, provided that, if the incorporated
|
||||
material is not limited to numerical parameters, data structure
|
||||
layouts and accessors, or small macros, inline functions and templates
|
||||
(ten or fewer lines in length), you do both of the following:
|
||||
|
||||
a) Give prominent notice with each copy of the object code that the
|
||||
Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
4. Combined Works.
|
||||
|
||||
You may convey a Combined Work under terms of your choice that,
|
||||
taken together, effectively do not restrict modification of the
|
||||
portions of the Library contained in the Combined Work and reverse
|
||||
engineering for debugging such modifications, if you also do each of
|
||||
the following:
|
||||
|
||||
a) Give prominent notice with each copy of the Combined Work that
|
||||
the Library is used in it and that the Library and its use are
|
||||
covered by this License.
|
||||
|
||||
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||
document.
|
||||
|
||||
c) For a Combined Work that displays copyright notices during
|
||||
execution, include the copyright notice for the Library among
|
||||
these notices, as well as a reference directing the user to the
|
||||
copies of the GNU GPL and this license document.
|
||||
|
||||
d) Do one of the following:
|
||||
|
||||
0) Convey the Minimal Corresponding Source under the terms of this
|
||||
License, and the Corresponding Application Code in a form
|
||||
suitable for, and under terms that permit, the user to
|
||||
recombine or relink the Application with a modified version of
|
||||
the Linked Version to produce a modified Combined Work, in the
|
||||
manner specified by section 6 of the GNU GPL for conveying
|
||||
Corresponding Source.
|
||||
|
||||
1) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (a) uses at run time
|
||||
a copy of the Library already present on the user's computer
|
||||
system, and (b) will operate properly with a modified version
|
||||
of the Library that is interface-compatible with the Linked
|
||||
Version.
|
||||
|
||||
e) Provide Installation Information, but only if you would otherwise
|
||||
be required to provide such information under section 6 of the
|
||||
GNU GPL, and only to the extent that such information is
|
||||
necessary to install and execute a modified version of the
|
||||
Combined Work produced by recombining or relinking the
|
||||
Application with a modified version of the Linked Version. (If
|
||||
you use option 4d0, the Installation Information must accompany
|
||||
the Minimal Corresponding Source and Corresponding Application
|
||||
Code. If you use option 4d1, you must provide the Installation
|
||||
Information in the manner specified by section 6 of the GNU GPL
|
||||
for conveying Corresponding Source.)
|
||||
|
||||
5. Combined Libraries.
|
||||
|
||||
You may place library facilities that are a work based on the
|
||||
Library side by side in a single library together with other library
|
||||
facilities that are not Applications and are not covered by this
|
||||
License, and convey such a combined library under terms of your
|
||||
choice, if you do both of the following:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based
|
||||
on the Library, uncombined with any other library facilities,
|
||||
conveyed under the terms of this License.
|
||||
|
||||
b) Give prominent notice with the combined library that part of it
|
||||
is a work based on the Library, and explaining where to find the
|
||||
accompanying uncombined form of the same work.
|
||||
|
||||
6. Revised Versions of the GNU Lesser General Public License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Lesser General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Library as you received it specifies that a certain numbered version
|
||||
of the GNU Lesser General Public License "or any later version"
|
||||
applies to it, you have the option of following the terms and
|
||||
conditions either of that published version or of any later version
|
||||
published by the Free Software Foundation. If the Library as you
|
||||
received it does not specify a version number of the GNU Lesser
|
||||
General Public License, you may choose any version of the GNU Lesser
|
||||
General Public License ever published by the Free Software Foundation.
|
||||
|
||||
If the Library as you received it specifies that a proxy can decide
|
||||
whether future versions of the GNU Lesser General Public License shall
|
||||
apply, that proxy's public statement of acceptance of any version is
|
||||
permanent authorization for you to choose that version for the
|
||||
Library.
|
39
repository/README.md
Normal file
@@ -0,0 +1,39 @@
|
||||
### Alfresco Repository
|
||||
Repository is a library packaged as a jar file which is part of [Alfresco Content Services Repository](https://community.alfresco.com/docs/DOC-6385-project-overview-repository).
|
||||
The library contains the following:
|
||||
* DAOs and SQL scripts
|
||||
* Various Service implementations
|
||||
* Utility classes
|
||||
|
||||
### Building and testing
|
||||
The project can be built by running Maven command:
|
||||
~~~
|
||||
mvn clean install
|
||||
~~~
|
||||
The tests are combined in test classes split by test type or Spring application context used in the test, see classes in _src/test/java/org/alfresco_. All of these classes as well as individual tests can be run by specifying the test class name and a set of DB connection properties, for example:
|
||||
~~~
|
||||
mvn clean test -Dtest=SomeRepoTest -Ddb.driver=org.postgresql.Driver -Ddb.name=alfresco -Ddb.url=jdbc:postgresql:alfresco -Ddb.username=alfresco -Ddb.password=alfresco
|
||||
~~~
|
||||
|
||||
### Artifacts
|
||||
The artifacts can be obtained by:
|
||||
* downloading from [Alfresco repository](https://artifacts.alfresco.com/nexus/content/groups/public)
|
||||
* getting as Maven dependency by adding the dependency to your pom file:
|
||||
~~~
|
||||
<dependency>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-repository</artifactId>
|
||||
<version>version</version>
|
||||
</dependency>
|
||||
~~~
|
||||
and Alfresco Maven repository:
|
||||
~~~
|
||||
<repository>
|
||||
<id>alfresco-maven-repo</id>
|
||||
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
|
||||
</repository>
|
||||
~~~
|
||||
The SNAPSHOT version of the artifact is **never** published.
|
||||
|
||||
### Contributing guide
|
||||
Please use [this guide](CONTRIBUTING.md) to make a contribution to the project.
|
67
repository/docs/README.md
Normal file
@@ -0,0 +1,67 @@
|
||||
# Community Technical Documentation Index
|
||||
|
||||
## Repository
|
||||
|
||||
### Meta-data Services
|
||||
* [Node Storage and Retrieval](./meta-data-services/node-storage-and-retrieval)
|
||||
* Dictionary
|
||||
* Files and Folders
|
||||
* Smart Folders
|
||||
* [Versions](./meta-data-services/versions)
|
||||
* Permissions
|
||||
* Tagging
|
||||
* Multilingual Content
|
||||
|
||||
### Content Store
|
||||
* Content Storage and Retrieval
|
||||
|
||||
### Rules Engine
|
||||
* Rules
|
||||
* Actions
|
||||
|
||||
### Workflow
|
||||
* Embedded Activiti
|
||||
|
||||
### Transformation
|
||||
* Renditions
|
||||
|
||||
### Content Analysis
|
||||
* Meta-data Extraction
|
||||
|
||||
### File Protocols
|
||||
* CIFS Protocol
|
||||
* FTP Protocol
|
||||
* WebDAV Protocol
|
||||
|
||||
### Application Protocols
|
||||
* IMAP Protocol
|
||||
* Office Protocols
|
||||
|
||||
### Scripting
|
||||
* JavaScript API
|
||||
* Freemarker API
|
||||
|
||||
### Sync and Transfer
|
||||
* Content Replication
|
||||
* Content Transfer
|
||||
|
||||
### Event Log
|
||||
* Audit
|
||||
* Log Messages
|
||||
|
||||
### Identity Provider
|
||||
* [Authentication](./identity-provider/authentication)
|
||||
* LDAP Sync
|
||||
|
||||
### Deployment
|
||||
* Installer
|
||||
* MMT
|
||||
* Patch
|
||||
|
||||
### Messaging
|
||||
* Messages and Topics
|
||||
|
||||
### Infrastructure
|
||||
* Module Framework
|
||||
* Policies and Behaviours
|
||||
* Multi-tenancy
|
BIN
repository/docs/event-log/audit/resource/data/audit-data.png
Normal file
After Width: | Height: | Size: 25 KiB |
@@ -0,0 +1,41 @@
|
||||
@startuml
|
||||
|
||||
title Audit and Attributes - High Level Entities
|
||||
|
||||
skinparam linetype ortho
|
||||
|
||||
rectangle AuditDAO #lightgrey {
|
||||
rectangle AuditApplication #orange
|
||||
rectangle AuditModel #white
|
||||
rectangle ModelContent #white
|
||||
rectangle AuditEntry #white
|
||||
}
|
||||
|
||||
rectangle PropertyValueDAO #lightgrey {
|
||||
rectangle Attribute #orange
|
||||
rectangle ComplexProperty #white
|
||||
rectangle SimpleProperty #white
|
||||
rectangle Value #white
|
||||
rectangle Caches #white {
|
||||
rectangle PropertyUniqueContextSharedCache #white
|
||||
rectangle PropertyClassSharedCache #white
|
||||
rectangle PropertyValueSharedCache #white
|
||||
}
|
||||
}
|
||||
|
||||
AuditApplication --* AuditModel
|
||||
AuditApplication --* AuditEntry
|
||||
AuditModel -- ModelContent
|
||||
PropertyClassSharedCache ->SimpleProperty
|
||||
PropertyValueSharedCache ->SimpleProperty
|
||||
PropertyUniqueContextSharedCache ->Attribute
|
||||
SimpleProperty .. Value :value
|
||||
SimpleProperty -- Attribute: keys (1 to 3)
|
||||
ComplexProperty -- SimpleProperty
|
||||
ComplexProperty -- AuditEntry :audit values
|
||||
ComplexProperty -- AuditApplication :disabled paths
|
||||
Attribute -- ComplexProperty
|
||||
|
||||
center footer Copyright 2016 Alfresco Software Inc
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 146 KiB |
After Width: | Height: | Size: 206 KiB |
After Width: | Height: | Size: 318 KiB |
@@ -0,0 +1,337 @@
|
||||
@startuml
|
||||
|
||||
' Generated using https://github.com/juanmf/Java2PlantUML
|
||||
|
||||
left to right direction
|
||||
' Participants
|
||||
|
||||
class org.alfresco.jlan.server.auth.AuthContext {
|
||||
--
|
||||
+ AuthContext()
|
||||
|
||||
}
|
||||
interface org.springframework.beans.factory.InitializingBean {
|
||||
--
|
||||
+ afterPropertiesSet() : void
|
||||
|
||||
}
|
||||
interface org.alfresco.repo.transaction.RetryingTransactionHelper$RetryingTransactionCallback <Result extends c Object> {
|
||||
--
|
||||
+ execute() : Object
|
||||
|
||||
}
|
||||
interface org.alfresco.jlan.server.SessionListener {
|
||||
--
|
||||
+ sessionClosed(c SrvSession) : void
|
||||
+ sessionCreated(c SrvSession) : void
|
||||
+ sessionLoggedOn(c SrvSession) : void
|
||||
|
||||
}
|
||||
interface org.alfresco.filesys.auth.cifs.package-info {
|
||||
--
|
||||
|
||||
}
|
||||
interface javax.security.auth.callback.CallbackHandler {
|
||||
--
|
||||
+ handle(c Callback;) : void
|
||||
|
||||
}
|
||||
class org.alfresco.filesys.auth.cifs.PassthruCifsAuthenticator {
|
||||
+ DefaultSessionTmo : int
|
||||
+ MaxCheckInterval : int
|
||||
+ MaxSessionTmo : int
|
||||
+ MinCheckInterval : int
|
||||
+ MinSessionTmo : int
|
||||
+ PassthruKeepAliveInterval : long
|
||||
- NTLM_FLAGS : int
|
||||
- logger : i Log
|
||||
- m_localPassThruServers : boolean
|
||||
- m_passthruServers : c PassthruServers
|
||||
- m_sessions : Hashtable< String, PassthruDetails>
|
||||
--
|
||||
+ PassthruCifsAuthenticator()
|
||||
# validateAuthenticationMode() : boolean
|
||||
+ authenticateShareConnect(c ClientInfo, c SharedDevice, c String, c SrvSession) : int
|
||||
+ authenticateUser(c ClientInfo, c SrvSession, int) : int
|
||||
+ closeAuthenticator() : void
|
||||
+ generateNegotiateResponse(c SMBSrvSession, c SMBSrvPacket, boolean) : void
|
||||
+ getAuthContext(c SMBSrvSession) : AuthContext
|
||||
+ getServerCapabilities() : int
|
||||
+ getSessions() : Hashtable
|
||||
+ initialize(c ServerConfiguration, i ConfigElement) : void
|
||||
+ processAlfrescoSessionSetup(c SMBSrvSession, c SMBSrvPacket) : void
|
||||
+ processSessionSetup(c SMBSrvSession, c SMBSrvPacket) : void
|
||||
+ sessionClosed(c SrvSession) : void
|
||||
+ sessionCreated(c SrvSession) : void
|
||||
+ sessionLoggedOn(c SrvSession) : void
|
||||
+ setPassthruServers(c PassthruServers) : void
|
||||
- doNTLMv1Logon(c SMBSrvSession, c ClientInfo, c Type3NTLMMessage) : void
|
||||
- doNtlmsspSessionSetup(c SMBSrvSession, c ClientInfo, class [B, int, int, boolean) : [B
|
||||
|
||||
}
|
||||
interface org.alfresco.repo.security.authentication.AuthenticationUtil$RunAsWork <Result extends c Object> {
|
||||
--
|
||||
+ doWork() : Object
|
||||
|
||||
}
|
||||
class org.alfresco.filesys.auth.cifs.AuthTokenAuthContext {
|
||||
- m_token : c NTLMPassthruToken
|
||||
--
|
||||
+ AuthTokenAuthContext(c NTLMPassthruToken)
|
||||
+ getChallenge() : [B
|
||||
+ getToken() : NTLMPassthruToken
|
||||
|
||||
}
|
||||
class org.alfresco.filesys.auth.cifs.CifsAuthenticatorBase {
|
||||
# logger : i Log
|
||||
# m_md4Encoder : i MD4PasswordEncoder
|
||||
- active : boolean
|
||||
- authenticationComponent : i AuthenticationComponent
|
||||
- authenticationService : i AuthenticationService
|
||||
- authorityService : i AuthorityService
|
||||
- diskInterface : i DiskInterface
|
||||
- nodeService : i NodeService
|
||||
- personService : i PersonService
|
||||
- transactionService : i TransactionService
|
||||
--
|
||||
+ CifsAuthenticatorBase()
|
||||
# checkForAdminUserName(c ClientInfo) : void
|
||||
# doGuestLogon(c ClientInfo, c SrvSession) : void
|
||||
# doInTransaction( RetryingTransactionHelper$RetryingTransactionCallback<T>) : Object
|
||||
# getAuthenticationComponent() : AuthenticationComponent
|
||||
# getAuthenticationService() : AuthenticationService
|
||||
# getAuthorityService() : AuthorityService
|
||||
# getHomeFolderForUser(c ClientInfo) : void
|
||||
# getNTLMAuthenticator() : NLTMAuthenticator
|
||||
# getNodeService() : NodeService
|
||||
# getPersonService() : PersonService
|
||||
# validateAuthenticationMode() : boolean
|
||||
+ afterPropertiesSet() : void
|
||||
+ destroy() : void
|
||||
+ initialize() : void
|
||||
+ initialize(c ServerConfiguration, i ConfigElement) : void
|
||||
+ isActive() : boolean
|
||||
+ mapUserNameToPerson(c String, boolean) : String
|
||||
+ setActive(boolean) : void
|
||||
+ setAuthenticationComponent(i AuthenticationComponent) : void
|
||||
+ setAuthenticationService(i AuthenticationService) : void
|
||||
+ setAuthorityService(i AuthorityService) : void
|
||||
+ setCurrentUser(c ClientInfo) : void
|
||||
+ setDiskInterface(i DiskInterface) : void
|
||||
+ setNodeService(i NodeService) : void
|
||||
+ setPersonService(i PersonService) : void
|
||||
+ setTransactionService(i TransactionService) : void
|
||||
- getTransactionService() : TransactionService
|
||||
|
||||
}
|
||||
class org.alfresco.jlan.server.auth.ChallengeAuthContext {
|
||||
# m_challenge : class [B
|
||||
--
|
||||
+ ChallengeAuthContext()
|
||||
+ getChallenge() : [B
|
||||
|
||||
}
|
||||
class org.alfresco.jlan.server.auth.CifsAuthenticator {
|
||||
# GUEST_USERNAME : c String
|
||||
# m_config : i ServerConfigurationAccessor
|
||||
# m_random : c Random
|
||||
- m_accessMode : int
|
||||
- m_allowGuest : boolean
|
||||
- m_debug : boolean
|
||||
- m_dialects : c DialectSelector
|
||||
- m_encryptor : c PasswordEncryptor
|
||||
- m_extendedSecurity : boolean
|
||||
- m_guestUserName : c String
|
||||
- m_mapToGuest : boolean
|
||||
- m_securityMode : int
|
||||
- m_sessCleanup : boolean
|
||||
--
|
||||
+ CifsAuthenticator()
|
||||
# convertPassword(c String) : [B
|
||||
# doGuestLogon(c ClientInfo, c SrvSession) : void
|
||||
# generateEncryptedPassword(c String, class [B, int, c String, c String) : [B
|
||||
# getEncryptor() : PasswordEncryptor
|
||||
# getStatusAsString(int) : String
|
||||
# mapClientAddressToDomain(c InetAddress) : String
|
||||
# setExtendedSecurity(boolean) : void
|
||||
# setSecurityMode(int) : void
|
||||
# validatePassword(c UserAccount, c ClientInfo, c AuthContext, int) : boolean
|
||||
+ allowGuest() : boolean
|
||||
+ authenticateShareConnect(c ClientInfo, c SharedDevice, c String, c SrvSession) : int
|
||||
+ authenticateUser(c ClientInfo, c SrvSession, int) : int
|
||||
+ authenticateUserPlainText(c ClientInfo, c SrvSession) : int
|
||||
+ closeAuthenticator() : void
|
||||
+ generateNegotiateResponse(c SMBSrvSession, c SMBSrvPacket, boolean) : void
|
||||
+ getAccessMode() : int
|
||||
+ getAuthContext(c SMBSrvSession) : AuthContext
|
||||
+ getCIFSConfig() : CIFSConfigSection
|
||||
+ getEnabledDialects() : DialectSelector
|
||||
+ getEncryptionKeyLength() : int
|
||||
+ getGuestUserName() : String
|
||||
+ getSecurityMode() : int
|
||||
+ getServerCapabilities() : int
|
||||
+ getUserDetails(c String) : UserAccount
|
||||
+ getsecurityConfig() : SecurityConfigSection
|
||||
+ hasDebug() : boolean
|
||||
+ hasExtendedSecurity() : boolean
|
||||
+ hasSessionCleanup() : boolean
|
||||
+ initialize() : void
|
||||
+ initialize(c ServerConfiguration, i ConfigElement) : void
|
||||
+ mapUnknownUserToGuest() : boolean
|
||||
+ processSessionSetup(c SMBSrvSession, c SMBSrvPacket) : void
|
||||
+ setAccessMode(int) : void
|
||||
+ setAllowGuest(boolean) : void
|
||||
+ setConfig(i ServerConfigurationAccessor) : void
|
||||
+ setCurrentUser(c ClientInfo) : void
|
||||
+ setDebug(boolean) : void
|
||||
+ setGuestUserName(c String) : void
|
||||
+ setMapToGuest(boolean) : void
|
||||
+ setSessionCleanup(boolean) : void
|
||||
+ toString() : String
|
||||
|
||||
}
|
||||
interface org.alfresco.jlan.server.auth.ICifsAuthenticator {
|
||||
+ AUTH_ACCDISABLED : int
|
||||
+ AUTH_ALLOW : int
|
||||
+ AUTH_BADPASSWORD : int
|
||||
+ AUTH_BADUSER : int
|
||||
+ AUTH_DISALLOW : int
|
||||
+ AUTH_GUEST : int
|
||||
+ AUTH_PASSEXPIRED : int
|
||||
+ LANMAN : int
|
||||
+ NTLM1 : int
|
||||
+ NTLM2 : int
|
||||
+ NoAccess : int
|
||||
+ ReadOnly : int
|
||||
+ SHARE_MODE : int
|
||||
+ STANDARD_CHALLENGE_LEN : int
|
||||
+ STANDARD_PASSWORD_LEN : int
|
||||
+ USER_MODE : int
|
||||
+ Writeable : int
|
||||
--
|
||||
+ authenticateShareConnect(c ClientInfo, c SharedDevice, c String, c SrvSession) : int
|
||||
+ authenticateUser(c ClientInfo, c SrvSession, int) : int
|
||||
+ closeAuthenticator() : void
|
||||
+ generateNegotiateResponse(c SMBSrvSession, c SMBSrvPacket, boolean) : void
|
||||
+ getAccessMode() : int
|
||||
+ getEncryptionKeyLength() : int
|
||||
+ getSecurityMode() : int
|
||||
+ getServerCapabilities() : int
|
||||
+ hasExtendedSecurity() : boolean
|
||||
+ processSessionSetup(c SMBSrvSession, c SMBSrvPacket) : void
|
||||
+ setCurrentUser(c ClientInfo) : void
|
||||
|
||||
}
|
||||
class org.alfresco.filesys.auth.cifs.EnterpriseCifsAuthenticator {
|
||||
# logger : i Log
|
||||
- LoginConfigEntry : c String
|
||||
- NTLM_FLAGS : int
|
||||
- disableNTLM : boolean
|
||||
- kerberosDebug : boolean
|
||||
- m_acceptNTLMv1 : boolean
|
||||
- m_accountName : c String
|
||||
- m_enableTicketCracking : boolean
|
||||
- m_krbRealm : c String
|
||||
- m_loginContext : c LoginContext
|
||||
- m_loginEntryName : c String
|
||||
- m_mecListMIC : c String
|
||||
- m_mechTypes : Vector< Oid>
|
||||
- m_negTokenInit : class [B
|
||||
- m_password : c String
|
||||
- m_stripKerberosUsernameSuffix : boolean
|
||||
- m_useRawNTLMSSP : boolean
|
||||
--
|
||||
+ EnterpriseCifsAuthenticator()
|
||||
+ generateNegotiateResponse(c SMBSrvSession, c SMBSrvPacket, boolean) : void
|
||||
+ getEncryptionKeyLength() : int
|
||||
+ getServerCapabilities() : int
|
||||
+ handle(c Callback;) : void
|
||||
+ initialize() : void
|
||||
+ initialize(c ServerConfiguration, i ConfigElement) : void
|
||||
+ processSessionSetup(c SMBSrvSession, c SMBSrvPacket) : void
|
||||
+ setDisableNTLM(boolean) : void
|
||||
+ setDisallowNTLMv1(boolean) : void
|
||||
+ setEnableTicketCracking(boolean) : void
|
||||
+ setJaasConfigEntryName(c String) : void
|
||||
+ setKerberosDebug(boolean) : void
|
||||
+ setPassword(c String) : void
|
||||
+ setRealm(c String) : void
|
||||
+ setStripKerberosUsernameSuffix(boolean) : void
|
||||
+ setUseSPNEGO(boolean) : void
|
||||
- acceptNTLMv1Logon() : boolean
|
||||
- doHashedPasswordLogon(c SMBSrvSession, c SMBSrvPacket) : void
|
||||
- doKerberosLogon(c SMBSrvSession, c NegTokenInit, c ClientInfo) : NegTokenTarg
|
||||
- doNTLMv1Logon(c SMBSrvSession, c ClientInfo) : void
|
||||
- doNTLMv1Logon(c SMBSrvSession, c ClientInfo, c Type3NTLMMessage) : void
|
||||
- doNTLMv2Logon(c SMBSrvSession, c ClientInfo) : void
|
||||
- doNTLMv2Logon(c SMBSrvSession, c ClientInfo, c Type3NTLMMessage) : void
|
||||
- doNTLMv2SessionKeyLogon(c SMBSrvSession, c ClientInfo, c Type3NTLMMessage) : void
|
||||
- doNtlmsspSessionSetup(c SMBSrvSession, c ClientInfo, class [B, int, int, boolean) : [B
|
||||
- doSpnegoSessionSetup(c SMBSrvSession, c ClientInfo, class [B, int, int, boolean) : [B
|
||||
- getNegTokenInit() : [B
|
||||
- isKerberosEnabled() : boolean
|
||||
- normalizeUserId(c String) : String
|
||||
- processAlfrescoSessionSetup(c SMBSrvSession, c SMBSrvPacket) : void
|
||||
- useRawNTLMSSP() : boolean
|
||||
|
||||
}
|
||||
interface org.springframework.beans.factory.DisposableBean {
|
||||
--
|
||||
+ destroy() : void
|
||||
|
||||
}
|
||||
class org.alfresco.filesys.auth.cifs.AlfrescoCifsAuthenticator {
|
||||
--
|
||||
+ AlfrescoCifsAuthenticator()
|
||||
# validateAuthenticationMode() : boolean
|
||||
+ authenticateShareConnect(c ClientInfo, c SharedDevice, c String, c SrvSession) : int
|
||||
+ authenticateUser(c ClientInfo, c SrvSession, int) : int
|
||||
+ getAuthContext(c SMBSrvSession) : AuthContext
|
||||
- doMD4UserAuthentication(c ClientInfo, c SrvSession, int) : int
|
||||
- doPassthruUserAuthentication(c ClientInfo, c SrvSession, int) : int
|
||||
|
||||
}
|
||||
interface org.alfresco.repo.management.subsystems.ActivateableBean {
|
||||
--
|
||||
+ isActive() : boolean
|
||||
|
||||
}
|
||||
|
||||
' Relations
|
||||
|
||||
org.alfresco.filesys.auth.cifs.CifsAuthenticatorBase "1" o-left- "1" org.alfresco.service.cmr.security.AuthenticationService : authenticationService: i AuthenticationService
|
||||
org.alfresco.filesys.auth.cifs.CifsAuthenticatorBase "1" o-left- "1" org.alfresco.service.cmr.security.PersonService : personService: i PersonService
|
||||
org.alfresco.filesys.auth.cifs.PassthruCifsAuthenticator "1" o-left- "1" org.apache.commons.logging.Log : logger: i Log
|
||||
org.alfresco.filesys.auth.cifs.EnterpriseCifsAuthenticator "1" o-left- "*" org.ietf.jgss.Oid : m_mechTypes: Vector< Oid>
|
||||
org.alfresco.jlan.server.auth.CifsAuthenticator "1" o-left- "1" org.alfresco.jlan.server.auth.PasswordEncryptor : m_encryptor: c PasswordEncryptor
|
||||
org.alfresco.filesys.auth.cifs.EnterpriseCifsAuthenticator "1" o-left- "1" org.apache.commons.logging.Log : logger: i Log
|
||||
org.alfresco.jlan.server.auth.CifsAuthenticator "1" o-left- "1" java.util.Random : m_random: c Random
|
||||
org.alfresco.filesys.auth.cifs.CifsAuthenticatorBase "1" o-left- "1" org.alfresco.service.transaction.TransactionService : transactionService: i TransactionService
|
||||
org.alfresco.filesys.auth.cifs.CifsAuthenticatorBase "1" o-left- "1" org.alfresco.jlan.server.filesys.DiskInterface : diskInterface: i DiskInterface
|
||||
org.alfresco.filesys.auth.cifs.CifsAuthenticatorBase "1" o-left- "1" org.apache.commons.logging.Log : logger: i Log
|
||||
org.alfresco.filesys.auth.cifs.PassthruCifsAuthenticator "1" o-left- "*" org.alfresco.jlan.server.auth.passthru.PassthruDetails : m_sessions: Hashtable< String, PassthruDetails>
|
||||
org.alfresco.filesys.auth.cifs.CifsAuthenticatorBase "1" o-left- "1" org.alfresco.repo.security.authentication.AuthenticationComponent : authenticationComponent: i AuthenticationComponent
|
||||
org.alfresco.filesys.auth.cifs.EnterpriseCifsAuthenticator "1" o-left- "1" javax.security.auth.login.LoginContext : m_loginContext: c LoginContext
|
||||
org.alfresco.filesys.auth.cifs.PassthruCifsAuthenticator "1" o-left- "1" org.alfresco.jlan.server.auth.passthru.PassthruServers : m_passthruServers: c PassthruServers
|
||||
org.alfresco.jlan.server.auth.CifsAuthenticator "1" o-left- "1" org.alfresco.jlan.smb.DialectSelector : m_dialects: c DialectSelector
|
||||
org.alfresco.jlan.server.auth.CifsAuthenticator "1" o-left- "1" org.alfresco.jlan.server.config.ServerConfigurationAccessor : m_config: i ServerConfigurationAccessor
|
||||
org.alfresco.filesys.auth.cifs.CifsAuthenticatorBase "1" o-left- "1" org.alfresco.service.cmr.repository.NodeService : nodeService: i NodeService
|
||||
org.alfresco.filesys.auth.cifs.AuthTokenAuthContext "1" o-left- "1" org.alfresco.repo.security.authentication.ntlm.NTLMPassthruToken : m_token: c NTLMPassthruToken
|
||||
org.alfresco.filesys.auth.cifs.CifsAuthenticatorBase "1" o-left- "1" org.alfresco.repo.security.authentication.MD4PasswordEncoder : m_md4Encoder: i MD4PasswordEncoder
|
||||
org.alfresco.filesys.auth.cifs.CifsAuthenticatorBase "1" o-left- "1" org.alfresco.service.cmr.security.AuthorityService : authorityService: i AuthorityService
|
||||
org.alfresco.filesys.auth.cifs.PassthruCifsAuthenticator -up|> org.alfresco.filesys.auth.cifs.CifsAuthenticatorBase
|
||||
org.alfresco.filesys.auth.cifs.AlfrescoCifsAuthenticator -up|> org.alfresco.filesys.auth.cifs.CifsAuthenticatorBase
|
||||
org.alfresco.filesys.auth.cifs.EnterpriseCifsAuthenticator -up|> org.alfresco.filesys.auth.cifs.CifsAuthenticatorBase
|
||||
org.alfresco.filesys.auth.cifs.CifsAuthenticatorBase -up|> org.alfresco.jlan.server.auth.CifsAuthenticator
|
||||
org.alfresco.jlan.server.auth.ChallengeAuthContext -up|> org.alfresco.jlan.server.auth.AuthContext
|
||||
org.alfresco.filesys.auth.cifs.AuthTokenAuthContext -up|> org.alfresco.jlan.server.auth.ChallengeAuthContext
|
||||
org.alfresco.filesys.auth.cifs.CifsAuthenticatorBase ..up|> org.springframework.beans.factory.DisposableBean
|
||||
org.alfresco.jlan.server.auth.CifsAuthenticator ..up|> org.alfresco.jlan.server.auth.ICifsAuthenticator
|
||||
org.alfresco.filesys.auth.cifs.CifsAuthenticatorBase ..up|> org.springframework.beans.factory.InitializingBean
|
||||
org.alfresco.filesys.auth.cifs.EnterpriseCifsAuthenticator ..up|> javax.security.auth.callback.CallbackHandler
|
||||
org.alfresco.filesys.auth.cifs.CifsAuthenticatorBase ..up|> org.alfresco.repo.management.subsystems.ActivateableBean
|
||||
org.alfresco.filesys.auth.cifs.PassthruCifsAuthenticator ..up|> org.alfresco.jlan.server.SessionListener
|
||||
|
||||
' Notes
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 427 KiB |
After Width: | Height: | Size: 139 KiB |
@@ -0,0 +1,113 @@
|
||||
@startuml
|
||||
|
||||
' Generated using https://github.com/juanmf/Java2PlantUML
|
||||
|
||||
left to right direction
|
||||
' Participants
|
||||
|
||||
interface org.alfresco.jlan.ftp.FTPAuthenticator {
|
||||
--
|
||||
+ authenticateUser(c ClientInfo, c FTPSrvSession) : boolean
|
||||
+ closeAuthenticator() : void
|
||||
+ initialize(c ServerConfiguration, i ConfigElement) : void
|
||||
|
||||
}
|
||||
interface org.springframework.beans.factory.DisposableBean {
|
||||
--
|
||||
+ destroy() : void
|
||||
|
||||
}
|
||||
interface org.alfresco.filesys.auth.ftp.package-info {
|
||||
--
|
||||
|
||||
}
|
||||
interface org.alfresco.repo.management.subsystems.ActivateableBean {
|
||||
--
|
||||
+ isActive() : boolean
|
||||
|
||||
}
|
||||
class org.alfresco.filesys.auth.ftp.FTPAuthenticatorBase {
|
||||
# logger : i Log
|
||||
# serverConfiguration : i ServerConfigurationAccessor
|
||||
- active : boolean
|
||||
- authenticationComponent : i AuthenticationComponent
|
||||
- authenticationService : i AuthenticationService
|
||||
- authorityService : i AuthorityService
|
||||
- transactionService : i TransactionService
|
||||
--
|
||||
+ FTPAuthenticatorBase()
|
||||
# checkForAdminUserName(c ClientInfo) : void
|
||||
# createTransaction() : UserTransaction
|
||||
# getAuthenticationComponent() : AuthenticationComponent
|
||||
# getAuthenticationService() : AuthenticationService
|
||||
# getAuthorityService() : AuthorityService
|
||||
# getNTLMAuthenticator() : NLTMAuthenticator
|
||||
# getTransactionService() : TransactionService
|
||||
+ authenticateUser(c ClientInfo, c FTPSrvSession) : boolean
|
||||
+ closeAuthenticator() : void
|
||||
+ destroy() : void
|
||||
+ initialize() : void
|
||||
+ initialize(c ServerConfiguration, i ConfigElement) : void
|
||||
+ isActive() : boolean
|
||||
+ setActive(boolean) : void
|
||||
+ setAuthenticationComponent(i AuthenticationComponent) : void
|
||||
+ setAuthenticationService(i AuthenticationService) : void
|
||||
+ setAuthorityService(i AuthorityService) : void
|
||||
+ setConfig(i ServerConfigurationAccessor) : void
|
||||
+ setTransactionService(i TransactionService) : void
|
||||
|
||||
}
|
||||
class org.alfresco.filesys.auth.ftp.PassthruFtpAuthenticator {
|
||||
+ DefaultSessionTmo : int
|
||||
+ MaxCheckInterval : int
|
||||
+ MaxSessionTmo : int
|
||||
+ MinCheckInterval : int
|
||||
+ MinSessionTmo : int
|
||||
+ PassthruKeepAliveInterval : long
|
||||
- m_localPassThruServers : boolean
|
||||
- m_passthruServers : c PassthruServers
|
||||
- m_passwordEncryptor : c PasswordEncryptor
|
||||
--
|
||||
+ PassthruFtpAuthenticator()
|
||||
# doGuestLogon(c AlfrescoClientInfo, c SrvSession) : void
|
||||
# getSecurityConfig() : SecurityConfigSection
|
||||
# mapClientAddressToDomain(c InetAddress) : String
|
||||
+ authenticateUser(c ClientInfo, c FTPSrvSession) : boolean
|
||||
+ closeAuthenticator() : void
|
||||
+ initialize() : void
|
||||
+ initialize(c ServerConfiguration, i ConfigElement) : void
|
||||
+ setPassthruServers(c PassthruServers) : void
|
||||
- doPassthruUserAuthentication(c ClientInfo, c SrvSession) : boolean
|
||||
|
||||
}
|
||||
class org.alfresco.filesys.auth.ftp.AlfrescoFtpAuthenticator {
|
||||
# m_encryptor : c PasswordEncryptor
|
||||
# m_md4Encoder : i MD4PasswordEncoder
|
||||
--
|
||||
+ AlfrescoFtpAuthenticator()
|
||||
# doGuestLogon(c AlfrescoClientInfo, c SrvSession) : void
|
||||
+ authenticateUser(c ClientInfo, c FTPSrvSession) : boolean
|
||||
|
||||
}
|
||||
|
||||
' Relations
|
||||
|
||||
org.alfresco.filesys.auth.ftp.AlfrescoFtpAuthenticator "1" o-left- "1" org.alfresco.repo.security.authentication.MD4PasswordEncoder : m_md4Encoder: i MD4PasswordEncoder
|
||||
org.alfresco.filesys.auth.ftp.FTPAuthenticatorBase "1" o-left- "1" org.alfresco.service.transaction.TransactionService : transactionService: i TransactionService
|
||||
org.alfresco.filesys.auth.ftp.AlfrescoFtpAuthenticator "1" o-left- "1" org.alfresco.jlan.server.auth.PasswordEncryptor : m_encryptor: c PasswordEncryptor
|
||||
org.alfresco.filesys.auth.ftp.FTPAuthenticatorBase "1" o-left- "1" org.apache.commons.logging.Log : logger: i Log
|
||||
org.alfresco.filesys.auth.ftp.FTPAuthenticatorBase "1" o-left- "1" org.alfresco.jlan.server.config.ServerConfigurationAccessor : serverConfiguration: i ServerConfigurationAccessor
|
||||
org.alfresco.filesys.auth.ftp.FTPAuthenticatorBase "1" o-left- "1" org.alfresco.repo.security.authentication.AuthenticationComponent : authenticationComponent: i AuthenticationComponent
|
||||
org.alfresco.filesys.auth.ftp.FTPAuthenticatorBase "1" o-left- "1" org.alfresco.service.cmr.security.AuthorityService : authorityService: i AuthorityService
|
||||
org.alfresco.filesys.auth.ftp.PassthruFtpAuthenticator "1" o-left- "1" org.alfresco.jlan.server.auth.PasswordEncryptor : m_passwordEncryptor: c PasswordEncryptor
|
||||
org.alfresco.filesys.auth.ftp.FTPAuthenticatorBase "1" o-left- "1" org.alfresco.service.cmr.security.AuthenticationService : authenticationService: i AuthenticationService
|
||||
org.alfresco.filesys.auth.ftp.PassthruFtpAuthenticator "1" o-left- "1" org.alfresco.jlan.server.auth.passthru.PassthruServers : m_passthruServers: c PassthruServers
|
||||
org.alfresco.filesys.auth.ftp.AlfrescoFtpAuthenticator -up|> org.alfresco.filesys.auth.ftp.FTPAuthenticatorBase
|
||||
org.alfresco.filesys.auth.ftp.PassthruFtpAuthenticator -up|> org.alfresco.filesys.auth.ftp.FTPAuthenticatorBase
|
||||
org.alfresco.filesys.auth.ftp.FTPAuthenticatorBase ..up|> org.alfresco.jlan.ftp.FTPAuthenticator
|
||||
org.alfresco.filesys.auth.ftp.FTPAuthenticatorBase ..up|> org.alfresco.repo.management.subsystems.ActivateableBean
|
||||
org.alfresco.filesys.auth.ftp.FTPAuthenticatorBase ..up|> org.springframework.beans.factory.DisposableBean
|
||||
|
||||
' Notes
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 491 KiB |
171
repository/docs/identity-provider/authentication/README.md
Normal file
@@ -0,0 +1,171 @@
|
||||
## Authentication
|
||||
|
||||

|
||||
|
||||
### Purpose
|
||||
|
||||
The purpose of this sub-component is to authenticate users.
|
||||
***
|
||||
|
||||
### Overview
|
||||
|
||||
In order to use any service in Alfresco, a user must be authenticated.
|
||||
|
||||
Alfresco provides a default Authentication implementation that uses userid's and passwored
|
||||
managed by Alfresco. But, importantly, Alfresco also allows the customer
|
||||
to integrate with a number of external Authentication providers including
|
||||
* Active Directory
|
||||
* Kerberos
|
||||
* NTLM
|
||||
* LDAP
|
||||
|
||||
***
|
||||
|
||||
### Artifacts and Guidance
|
||||
|
||||
* Source Code Links:
|
||||
* https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root/enterpriseprojects/repository/source/java/
|
||||
* https://github.com/Alfresco/alfresco-data-model/tree/master/src/main/java/org/alfresco/repo/security/authentication
|
||||
* License: LGPL
|
||||
* Issue Tracker Link: https://issues.alfresco.com/jira/issues/?jql=project%3DREPO
|
||||
* Documentation Link: http://docs.alfresco.com/5.2/concepts/auth-intro.html
|
||||
* Contribution Model: Alfresco Open Source
|
||||
***
|
||||
|
||||
|
||||
### Prerequisite Knowledge
|
||||
|
||||
* [Acegi](http://springinpractice.com/2008/02/26/acegi-overview)
|
||||
* [CAS](https://en.wikipedia.org/wiki/Central_Authentication_Service)
|
||||
* [JAAS](http://docs.oracle.com/javase/8/docs/technotes/guides/security/jaas/JAASRefGuide.html)
|
||||
* [Kerberos](https://msdn.microsoft.com/en-us/library/bb742516.aspx)
|
||||
* [LDAP](https://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol)
|
||||
* [NTLM](https://msdn.microsoft.com/en-us/library/windows/desktop/aa378749(v=vs.85).aspx)
|
||||
|
||||
***
|
||||
|
||||
### Design
|
||||
|
||||
#### Default Authentication
|
||||
|
||||
In order to use any service in Alfresco, a user or client must be authenticated.
|
||||
|
||||
There is a default implementation provided that authenticates users based on a userid and password, where the userid's and passwords
|
||||
are stored in the Alfresco repository.
|
||||
|
||||
#### Chaining
|
||||
|
||||
Most production systems that use Alfresco will rely upon more secure approaches, so Alfresco also allows the
|
||||
customer to integrate a choice of existing authentication providers, including *Active Directory*, *Kerberos*, *LDAP* and *NTLM*.
|
||||
|
||||
The implementation of each such Authorization provider is delivered as a separate Alfresco Subsystem.
|
||||
The Subsystems are chained together as an ordered list of providers each of which, in turn, will be given
|
||||
a chance to authenticate the user, until the user is authenticated or there are no providers, in
|
||||
which case the authentication of the user fails.
|
||||
|
||||
|
||||
#### Component Model
|
||||
|
||||
#### Data Model
|
||||

|
||||
|
||||
#### Data Dictionary
|
||||
|
||||
#### Flows
|
||||
|
||||
##### Login Flow
|
||||
|
||||
##### Default Authentication Login Flow
|
||||
This flow starts when the Login Post request
|
||||
depicted in [Client Login](../../../share/share-app/resource/sequence/client-login-sequence.png) reaches the repository tier.
|
||||

|
||||
|
||||
##### Default Authentication Logoff Flow
|
||||

|
||||
|
||||
##### Kerberos Authentication Login Flow
|
||||

|
||||
|
||||
##### NTLM Authentication Login Flow
|
||||

|
||||
|
||||
#### Class Diagram
|
||||

|
||||
|
||||
|
||||
### APIs and Interfaces
|
||||
|
||||
#### Java
|
||||
|
||||
The sub-component provides a definition and implementation of the following
|
||||
Java interfaces.
|
||||
|
||||
* **Authentication Service**
|
||||
**Note**: This service is part of the Public API
|
||||
* authenticate using a user name and password
|
||||
* authenticate using a ticket
|
||||
* create, update and delete authentication information
|
||||
* clear the current authentication
|
||||
* invalidate a ticket
|
||||
* get the username for who is currently authenticated
|
||||
* get a ticket for subsequent re-authentication
|
||||
* determine if the current user is 'the system user
|
||||
* **MutableAuthenticationService*
|
||||
|
||||
In addition, there are a number of related interfaces that provide
|
||||
a way to manage users and groups and permissions
|
||||

|
||||
*This information should probably move to the Identity sub-component after the content already there (future design thoughts)
|
||||
is relocated*
|
||||
|
||||
* **Authority Service**
|
||||
**Note**: This service is part of the Public API
|
||||
* create authority identifiers
|
||||
* query for authority identifiers
|
||||
* delete authority identifiers
|
||||
* organize authority identifiers into hierarchies
|
||||
* query against authority identifiers hierarchies
|
||||
* find all the authorties that apply to the current authenticated user
|
||||
* determine if the current authenticated user has admin rights
|
||||
* **Ownable Service**
|
||||
**Note**: This service is **not** part of the Public API
|
||||
* determine the owner of a node;
|
||||
* set the owner of a node;
|
||||
* determine if a node has an owner
|
||||
* allow the current user to take ownership of a node
|
||||
* **Person Service**
|
||||
**Note**: This service is part of the Public API
|
||||
* obtain a reference to the Person node for a given user name
|
||||
* determine if a person entry exists for a user
|
||||
* create missing people entries, with default settings, on demand
|
||||
* supply a list of mutable properties for each person
|
||||
* create, delete and update personal information
|
||||
***
|
||||
#### REST
|
||||
|
||||
The sub-component provides the following REST API
|
||||
* https://api-explorer.alfresco.com/api-explorer/#/authentication
|
||||
|
||||
### Configuration
|
||||
***
|
||||
|
||||
### Performance Considerations
|
||||

|
||||
Describe Caching of tickets
|
||||
As mentioned in the *Security Considerations* section, Bcrypt can be used to encrypt passwords. Note that is
|
||||
is much slower than MD4 or SHA-256.
|
||||
***
|
||||
|
||||
### Security Considerations
|
||||
***
|
||||
In the case of the default Authentication provider, Alfresco is responsible for storing
|
||||
userid's and passwords. The passwords are stored as hashed values. The default hashing
|
||||
algorithm used is MD4, but the customer can also elect to use more secure hashing algorithms
|
||||
include SHA-256 and Bcrypt. The system property *system.preferred.password.encoding* is used
|
||||
to select which algorithm is used.
|
||||
|
||||
### Cloud Considerations
|
||||
|
||||

|
||||
Describe OAuth2 for protection of Cloud REST API's.
|
||||
***
|
After Width: | Height: | Size: 180 KiB |
@@ -0,0 +1,117 @@
|
||||
@startuml
|
||||
|
||||
Title: Default Authentication Login Flow
|
||||
|
||||
participant "Repository\nContainer" as W
|
||||
participant "LoginPost\nbean" as LB
|
||||
participant "SubsystemChaining\nAuthenticationService" as SCAS
|
||||
participant "MutableAuthentication\nServiceImpl" as AS
|
||||
participant "Authentication\nComponentImpl" as AC
|
||||
participant "PersonServiceImpl" as PS
|
||||
participant "NodeService" as NS
|
||||
participant "Authentication\nContextImpl" as ACX
|
||||
participant "Authentication\nUtil" as AU
|
||||
participant "InMemoryTicketComponentImpl" as ITC
|
||||
participant "AuthorityServiceImpl" as AUS
|
||||
participant "RepositoryAuthenticatedUser" as RAU
|
||||
participant "RepositoryAuthenticationDao" as RAD
|
||||
participant "MD4PasswordEncoderImpl" as MPE
|
||||
participant "RepositoryAuthenticationProvider" as RAP
|
||||
participant "CompositePasswordEncoder" as CPE
|
||||
|
||||
activate W
|
||||
W->LB: login request <username> <password>
|
||||
LB->LB: login <username> <password>
|
||||
LB->SCAS:authenticate <username> <password>
|
||||
note right of SCAS
|
||||
allowedUsers and maxUsers check
|
||||
end note
|
||||
SCAS->SCAS: preAuthenticationCheck
|
||||
note right of SCAS
|
||||
get list of usableAuthenticationServices
|
||||
and iterates over this list. In
|
||||
this default case there is a single
|
||||
service 'alfrescoNtlm'
|
||||
end note
|
||||
SCAS->AS: authenticate\n<username> <password>
|
||||
AS->AC:clearCurrentSecurityContext
|
||||
AC->ACX:clearCurrentSecurityContext
|
||||
ACX->AU:clearCurrentSecurityContext
|
||||
AU->ACX: done
|
||||
ACX->AC: done
|
||||
AC->AS: done
|
||||
AS->ITC:clearCurrentTicket
|
||||
ITC->AS: done
|
||||
note right of AS
|
||||
allowedUsers and maxUsers check
|
||||
end note
|
||||
AS->AS: preAuthenticationCheck
|
||||
note right of AS
|
||||
Checks cache to detect
|
||||
Brute Force attack
|
||||
end note
|
||||
AS->AS: isUserProtected <username>
|
||||
AS->AC: authenticate\n<username> <password>
|
||||
AC->PS:getUserIdentifier <username>
|
||||
PS->PS:getPersonOrNullImpl
|
||||
PS->PS:looks for Person\nin Cache
|
||||
PS->NS:get properties of Person\nand checks if\nneeds to add to cache
|
||||
PS->AC: username
|
||||
note right of AC
|
||||
Checks for guest
|
||||
end note
|
||||
AC->AC:isGuestUserName
|
||||
AC->AC: authenticateImpl <username> <password>
|
||||
AC->AU: getUserTenant
|
||||
AU->AC: tenant
|
||||
group Retrying Transaction
|
||||
AC->RAD: loadUserByUsername <username>
|
||||
RAD->RAU: constructor <username> <hashedpassword>
|
||||
RAD->AC: user details
|
||||
AC->RAP: isPasswordCorrect\n(UsernamePasswordAuthenticationToken, user details)
|
||||
RAP->CPE: matches
|
||||
CPE->MPE:isPasswordValid
|
||||
MPE->MPE:encodeInternal
|
||||
MPE->MPE: true
|
||||
MPE->RAP: true
|
||||
RAP->AC: true
|
||||
AC->AUS: isAdminAuthority
|
||||
AUS->AC: false
|
||||
AC->PS:getPersonOrNullImpl
|
||||
PS->PS:looks for Person\nin Cache
|
||||
PS->NS:get properties of Person\nand checks if\nneeds to add to cache
|
||||
NS->PS: properties
|
||||
PS->AC: username
|
||||
end
|
||||
group setCurrentUser <username>
|
||||
AC->ACX: isSystemUserName <username>
|
||||
ACX->AC: false
|
||||
AC->AC: setUserDetails (role=<b>ROLE_AUTHENTICATED</b>)
|
||||
end
|
||||
note right of AC
|
||||
Increment numberSuccessfulAuthentications
|
||||
end note
|
||||
AC->AC: onAuthenticate
|
||||
AC->AS: succeeded
|
||||
AS->ITC: clearCurrentTicket
|
||||
ITC->AS: done
|
||||
AS->ITC: getCurrentTicket (auto create off)
|
||||
ITC->AS
|
||||
AS->AS: getNewTicket
|
||||
AS->AS: preAuthenticationCheck
|
||||
AS->ITC: getNewTicket
|
||||
AS->SCAS
|
||||
SCAS->LB
|
||||
note right of LB
|
||||
Put ticket into the model
|
||||
end note
|
||||
LB->AS: getCurrentTicket
|
||||
AS->LB: ticket
|
||||
LB->W: Login Request Response
|
||||
note right of W
|
||||
Authentication TICKET
|
||||
returned in model
|
||||
end note
|
||||
deactivate W
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 383 KiB |
@@ -0,0 +1,310 @@
|
||||
@startuml
|
||||
|
||||
' Generated using https://github.com/juanmf/Java2PlantUML
|
||||
|
||||
left to right direction
|
||||
' Participants
|
||||
|
||||
interface org.alfresco.repo.security.authentication.AlfrescoSecureContext {
|
||||
--
|
||||
+ getEffectiveAuthentication() : Authentication
|
||||
+ getRealAuthentication() : Authentication
|
||||
+ setEffectiveAuthentication(i Authentication) : void
|
||||
+ setRealAuthentication(i Authentication) : void
|
||||
|
||||
}
|
||||
interface net.sf.acegisecurity.context.security.SecureContext {
|
||||
--
|
||||
+ getAuthentication() : Authentication
|
||||
+ setAuthentication(i Authentication) : void
|
||||
|
||||
}
|
||||
class org.alfresco.repo.security.authentication.AuthenticationUtil$ThreadLocalStack {
|
||||
--
|
||||
~ AuthenticationUtil$ThreadLocalStack()
|
||||
# initialValue() : Stack
|
||||
|
||||
}
|
||||
class org.alfresco.repo.security.authentication.TicketExpiredException {
|
||||
- serialVersionUID : long
|
||||
--
|
||||
+ TicketExpiredException(c String)
|
||||
+ TicketExpiredException(c String, c Throwable)
|
||||
|
||||
}
|
||||
class org.alfresco.repo.security.authentication.InMemoryTicketComponentImpl$Ticket {
|
||||
- expires : c InMemoryTicketComponentImpl$ExpiryMode
|
||||
- expiryDate : c Date
|
||||
- serialVersionUID : long
|
||||
- testDuration : c Duration
|
||||
- ticketId : c String
|
||||
- userName : c String
|
||||
- validDuration : c Duration
|
||||
--
|
||||
- InMemoryTicketComponentImpl$Ticket(c InMemoryTicketComponentImpl$ExpiryMode, c Date, c String, c Duration, c String)
|
||||
~ InMemoryTicketComponentImpl$Ticket(c InMemoryTicketComponentImpl$ExpiryMode, c Date, c String, c Duration)
|
||||
# getExpires() : InMemoryTicketComponentImpl$ExpiryMode
|
||||
# getExpiryDate() : Date
|
||||
# getTicketId() : String
|
||||
# getUserName() : String
|
||||
+ equals(c Object) : boolean
|
||||
+ hashCode() : int
|
||||
~ getNewEntry() : InMemoryTicketComponentImpl$Ticket
|
||||
~ hasExpired(c Date) : boolean
|
||||
|
||||
}
|
||||
class org.alfresco.repo.security.authentication.InMemoryTicketComponentImpl {
|
||||
+ GRANTED_AUTHORITY_TICKET_PREFIX : c String
|
||||
- currentTicket : ThreadLocal< String>
|
||||
- expiryMode : c InMemoryTicketComponentImpl$ExpiryMode
|
||||
- guid : c String
|
||||
- oneOff : boolean
|
||||
- ticketsCache : SimpleCache< String, InMemoryTicketComponentImpl$Ticket>
|
||||
- ticketsExpire : boolean
|
||||
- useSingleTicketPerUser : boolean
|
||||
- validDuration : c Duration
|
||||
--
|
||||
+ InMemoryTicketComponentImpl()
|
||||
+ clearCurrentSecurityContext() : void
|
||||
+ clearCurrentTicket() : void
|
||||
+ countTickets(boolean) : int
|
||||
+ equals(c Object) : boolean
|
||||
+ getAuthorityForTicket(c String) : String
|
||||
+ getCurrentTicket(c String, boolean) : String
|
||||
+ getNewTicket(c String) : String
|
||||
+ getUseSingleTicketPerUser() : boolean
|
||||
+ getUsersWithTickets(boolean) : Set
|
||||
+ hashCode() : int
|
||||
+ invalidateTicketById(c String) : void
|
||||
+ invalidateTicketByUser(c String) : void
|
||||
+ invalidateTickets(boolean) : int
|
||||
+ setExpiryMode(c String) : void
|
||||
+ setOneOff(boolean) : void
|
||||
+ setTicketsCache( SimpleCache< String, InMemoryTicketComponentImpl$Ticket>) : void
|
||||
+ setTicketsExpire(boolean) : void
|
||||
+ setUseSingleTicketPerUser(boolean) : void
|
||||
+ setValidDuration(c String) : void
|
||||
+ validateTicket(c String) : String
|
||||
- findNonExpiredUserTicket(c String) : InMemoryTicketComponentImpl$Ticket
|
||||
- getTicketByTicketString(c String) : InMemoryTicketComponentImpl$Ticket
|
||||
- getTicketKey(c String) : String
|
||||
|
||||
}
|
||||
interface org.springframework.beans.factory.InitializingBean {
|
||||
--
|
||||
+ afterPropertiesSet() : void
|
||||
|
||||
}
|
||||
interface org.alfresco.repo.security.authentication.AuthenticationStep {
|
||||
--
|
||||
+ getArgs() : Object;
|
||||
+ getKey() : String
|
||||
+ getMessage() : String
|
||||
+ isSuccess() : boolean
|
||||
|
||||
}
|
||||
interface org.alfresco.repo.security.authentication.AuthenticationUtil$RunAsWork <Result extends c Object> {
|
||||
--
|
||||
+ doWork() : Object
|
||||
|
||||
}
|
||||
class org.alfresco.repo.security.authentication.AuthenticationUtil {
|
||||
+ SYSTEM_USER_NAME : c String
|
||||
- defaultAdminUserName : c String
|
||||
- defaultGuestUserName : c String
|
||||
- initialized : boolean
|
||||
- mtEnabled : boolean
|
||||
- threadLocalFullAuthenticationStack : ThreadLocal< Stack< Authentication>>
|
||||
- threadLocalRunAsAuthenticationStack : ThreadLocal< Stack< Authentication>>
|
||||
- threadLocalTenantDomainStack : ThreadLocal< Stack< String>>
|
||||
~ s_logger : i Log
|
||||
--
|
||||
+ AuthenticationUtil()
|
||||
+ afterPropertiesSet() : void
|
||||
+ clearCurrentSecurityContext() : void
|
||||
+ getAdminRoleName() : String
|
||||
+ getAdminUserName() : String
|
||||
+ getFullAuthentication() : Authentication
|
||||
+ getFullyAuthenticatedUser() : String
|
||||
+ getGuestRoleName() : String
|
||||
+ getGuestUserName() : String
|
||||
+ getRunAsAuthentication() : Authentication
|
||||
+ getRunAsUser() : String
|
||||
+ getSystemUserName() : String
|
||||
+ getUserTenant(c String) : Pair
|
||||
+ isMtEnabled() : boolean
|
||||
+ isRunAsUserTheSystemUser() : boolean
|
||||
+ logAuthenticatedUsers() : void
|
||||
+ logNDC(c String) : void
|
||||
+ popAuthentication() : void
|
||||
+ pushAuthentication() : void
|
||||
+ runAs( AuthenticationUtil$RunAsWork<R>, c String) : Object
|
||||
+ runAsSystem( AuthenticationUtil$RunAsWork<R>) : Object
|
||||
+ setAdminUserAsFullyAuthenticatedUser() : Authentication
|
||||
+ setDefaultAdminUserName(c String) : void
|
||||
+ setDefaultGuestUserName(c String) : void
|
||||
+ setFullAuthentication(i Authentication) : Authentication
|
||||
+ setFullyAuthenticatedUser(c String) : Authentication
|
||||
+ setMtEnabled(boolean) : void
|
||||
+ setRunAsUser(c String) : Authentication
|
||||
+ setRunAsUserSystem() : Authentication
|
||||
- getAuthenticationToken(c String, i UserDetails) : UsernamePasswordAuthenticationToken
|
||||
- getDefaultUserDetails(c String) : UserDetails
|
||||
- getUserName(i Authentication) : String
|
||||
- setFullyAuthenticatedUser(c String, i UserDetails) : Authentication
|
||||
~ setRunAsAuthentication(i Authentication) : Authentication
|
||||
~ setRunAsUser(c String, i UserDetails) : Authentication
|
||||
|
||||
}
|
||||
class org.alfresco.repo.security.authentication.AuthenticationException {
|
||||
- serialVersionUID : long
|
||||
~ diagnostic : c AuthenticationDiagnostic
|
||||
--
|
||||
+ AuthenticationException(c String)
|
||||
+ AuthenticationException(c String, c AuthenticationDiagnostic)
|
||||
+ AuthenticationException(c String, c AuthenticationDiagnostic, c Object;, c Throwable)
|
||||
+ AuthenticationException(c String, c AuthenticationDiagnostic, c Throwable)
|
||||
+ AuthenticationException(c String, c Object;)
|
||||
+ AuthenticationException(c String, c Object;, c AuthenticationDiagnostic)
|
||||
+ AuthenticationException(c String, c Object;, c Throwable)
|
||||
+ AuthenticationException(c String, c Throwable)
|
||||
+ getDiagnostic() : AuthenticationDiagnostic
|
||||
|
||||
}
|
||||
class org.alfresco.error.AlfrescoRuntimeException {
|
||||
- MESSAGE_DELIMITER : c String
|
||||
- errorCounter : c AtomicInteger
|
||||
- msgId : c String
|
||||
- msgParams : c Object;
|
||||
- serialVersionUID : long
|
||||
--
|
||||
+ AlfrescoRuntimeException(c String)
|
||||
+ AlfrescoRuntimeException(c String, c Object;)
|
||||
+ AlfrescoRuntimeException(c String, c Object;, c Throwable)
|
||||
+ AlfrescoRuntimeException(c String, c Throwable)
|
||||
+ create(c String, c Object;) : AlfrescoRuntimeException
|
||||
+ create(c Throwable, c String, c Object;) : AlfrescoRuntimeException
|
||||
+ getMsgId() : String
|
||||
+ getMsgParams() : Object;
|
||||
+ getNumericalId() : String
|
||||
+ getRootCause() : Throwable
|
||||
+ makeRuntimeException(c Throwable, c String, c Object;) : RuntimeException
|
||||
- buildErrorLogNumber(c String) : String
|
||||
- padInt(c StringBuilder, int, int) : void
|
||||
- resolveMessage(c String, c Object;) : String
|
||||
|
||||
}
|
||||
class org.alfresco.repo.security.authentication.AuthenticationDiagnostic {
|
||||
+ STEP_KEY_LDAP_AUTHENTICATION : c String
|
||||
+ STEP_KEY_LDAP_CONNECTED : c String
|
||||
+ STEP_KEY_LDAP_CONNECTING : c String
|
||||
+ STEP_KEY_LDAP_FORMAT_USER : c String
|
||||
+ STEP_KEY_LDAP_LOOKEDUP_USER : c String
|
||||
+ STEP_KEY_LDAP_LOOKUP_USER : c String
|
||||
+ STEP_KEY_LDAP_SEARCH : c String
|
||||
+ STEP_KEY_VALIDATION : c String
|
||||
+ STEP_KEY_VALIDATION_AUTHENTICATOR_NOT_ACTIVE : c String
|
||||
+ STEP_KEY_VALIDATION_AUTHENTICATOR_NOT_FOUND : c String
|
||||
- serialVersionUID : long
|
||||
- steps : List< AuthenticationStep>
|
||||
--
|
||||
+ AuthenticationDiagnostic()
|
||||
+ addStep(c String, boolean) : void
|
||||
+ addStep(c String, boolean, c Object;) : void
|
||||
+ addStep(i AuthenticationStep) : void
|
||||
+ getSteps() : List
|
||||
|
||||
}
|
||||
class org.alfresco.repo.security.authentication.AuthenticationStepImpl {
|
||||
- serialVersionUID : long
|
||||
~ args : c Object;
|
||||
~ key : c String
|
||||
~ success : boolean
|
||||
--
|
||||
+ AuthenticationStepImpl(c String)
|
||||
+ getArgs() : Object;
|
||||
+ getKey() : String
|
||||
+ getMessage() : String
|
||||
+ isSuccess() : boolean
|
||||
+ toString() : String
|
||||
|
||||
}
|
||||
interface net.sf.acegisecurity.context.Context {
|
||||
--
|
||||
+ validate() : void
|
||||
|
||||
}
|
||||
class org.alfresco.repo.security.authentication.AlfrescoSecureContextImpl {
|
||||
- effectiveAuthentication : i Authentication
|
||||
- realAuthentication : i Authentication
|
||||
- serialVersionUID : long
|
||||
--
|
||||
+ AlfrescoSecureContextImpl()
|
||||
+ equals(c Object) : boolean
|
||||
+ getAuthentication() : Authentication
|
||||
+ getEffectiveAuthentication() : Authentication
|
||||
+ getRealAuthentication() : Authentication
|
||||
+ hashCode() : int
|
||||
+ setAuthentication(i Authentication) : void
|
||||
+ setEffectiveAuthentication(i Authentication) : void
|
||||
+ setRealAuthentication(i Authentication) : void
|
||||
+ toString() : String
|
||||
+ validate() : void
|
||||
|
||||
}
|
||||
enum org.alfresco.repo.security.authentication.InMemoryTicketComponentImpl$ExpiryMode {
|
||||
+ AFTER_FIXED_TIME : c InMemoryTicketComponentImpl$ExpiryMode
|
||||
+ AFTER_INACTIVITY : c InMemoryTicketComponentImpl$ExpiryMode
|
||||
+ DO_NOT_EXPIRE : c InMemoryTicketComponentImpl$ExpiryMode
|
||||
--
|
||||
- InMemoryTicketComponentImpl$ExpiryMode()
|
||||
+ valueOf(c String) : InMemoryTicketComponentImpl$ExpiryMode
|
||||
+ values() : InMemoryTicketComponentImpl$ExpiryMode;
|
||||
|
||||
}
|
||||
interface org.alfresco.repo.security.authentication.TicketComponent {
|
||||
--
|
||||
+ clearCurrentTicket() : void
|
||||
+ countTickets(boolean) : int
|
||||
+ getAuthorityForTicket(c String) : String
|
||||
+ getCurrentTicket(c String, boolean) : String
|
||||
+ getNewTicket(c String) : String
|
||||
+ getUseSingleTicketPerUser() : boolean
|
||||
+ getUsersWithTickets(boolean) : Set
|
||||
+ invalidateTicketById(c String) : void
|
||||
+ invalidateTicketByUser(c String) : void
|
||||
+ invalidateTickets(boolean) : int
|
||||
+ validateTicket(c String) : String
|
||||
|
||||
}
|
||||
|
||||
' Relations
|
||||
|
||||
org.alfresco.repo.security.authentication.InMemoryTicketComponentImpl "1" o-left- "1" org.alfresco.repo.cache.SimpleCache : ticketsCache: SimpleCache< String, InMemoryTicketComponentImpl$Ticket>
|
||||
org.alfresco.repo.security.authentication.AlfrescoSecureContextImpl "1" o-left- "1" net.sf.acegisecurity.Authentication : realAuthentication: i Authentication
|
||||
org.alfresco.repo.security.authentication.InMemoryTicketComponentImpl$Ticket "1" o-left- "1" org.alfresco.repo.security.authentication.InMemoryTicketComponentImpl$ExpiryMode : expires: c InMemoryTicketComponentImpl$ExpiryMode
|
||||
org.alfresco.error.AlfrescoRuntimeException "1" o-left- "1" java.util.concurrent.atomic.AtomicInteger : errorCounter: c AtomicInteger
|
||||
org.alfresco.repo.security.authentication.InMemoryTicketComponentImpl$Ticket "1" o-left- "1" org.alfresco.service.cmr.repository.datatype.Duration : testDuration: c Duration
|
||||
org.alfresco.repo.security.authentication.InMemoryTicketComponentImpl$Ticket "1" o-left- "1" org.alfresco.service.cmr.repository.datatype.Duration : validDuration: c Duration
|
||||
org.alfresco.repo.security.authentication.AuthenticationUtil "1" o-left- "1" org.apache.commons.logging.Log : s_logger: i Log
|
||||
org.alfresco.repo.security.authentication.InMemoryTicketComponentImpl "1" o-left- "1" org.alfresco.repo.security.authentication.InMemoryTicketComponentImpl$ExpiryMode : expiryMode: c InMemoryTicketComponentImpl$ExpiryMode
|
||||
org.alfresco.repo.security.authentication.AuthenticationException "1" o-left- "1" org.alfresco.repo.security.authentication.AuthenticationDiagnostic : diagnostic: c AuthenticationDiagnostic
|
||||
org.alfresco.repo.security.authentication.InMemoryTicketComponentImpl$Ticket "1" o-left- "1" java.util.Date : expiryDate: c Date
|
||||
org.alfresco.repo.security.authentication.InMemoryTicketComponentImpl "1" o-left- "1" org.alfresco.service.cmr.repository.datatype.Duration : validDuration: c Duration
|
||||
org.alfresco.repo.security.authentication.AlfrescoSecureContextImpl "1" o-left- "1" net.sf.acegisecurity.Authentication : effectiveAuthentication: i Authentication
|
||||
org.alfresco.repo.security.authentication.AuthenticationException -up|> org.alfresco.error.AlfrescoRuntimeException
|
||||
org.alfresco.repo.security.authentication.TicketExpiredException -up|> org.alfresco.repo.security.authentication.AuthenticationException
|
||||
"net.sf.acegisecurity.context.Context" -() Serializable
|
||||
"org.alfresco.repo.security.authentication.AuthenticationStepImpl" -() Serializable
|
||||
org.alfresco.repo.security.authentication.AlfrescoSecureContext ..up|> net.sf.acegisecurity.context.security.SecureContext
|
||||
org.alfresco.repo.security.authentication.AuthenticationStepImpl ..up|> org.alfresco.repo.security.authentication.AuthenticationStep
|
||||
org.alfresco.repo.security.authentication.InMemoryTicketComponentImpl ..up|> org.alfresco.repo.security.authentication.TicketComponent
|
||||
net.sf.acegisecurity.context.security.SecureContext ..up|> net.sf.acegisecurity.context.Context
|
||||
"org.alfresco.repo.security.authentication.AuthenticationDiagnostic" -() Serializable
|
||||
"org.alfresco.repo.security.authentication.InMemoryTicketComponentImpl$Ticket" -() Serializable
|
||||
org.alfresco.repo.security.authentication.AlfrescoSecureContextImpl ..up|> org.alfresco.repo.security.authentication.AlfrescoSecureContext
|
||||
org.alfresco.repo.security.authentication.AuthenticationUtil ..up|> org.springframework.beans.factory.InitializingBean
|
||||
|
||||
' Notes
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 369 KiB |
@@ -0,0 +1,344 @@
|
||||
@startuml
|
||||
|
||||
left to right direction
|
||||
|
||||
' Generated using https://github.com/juanmf/Java2PlantUML
|
||||
|
||||
' Participants
|
||||
|
||||
class org.alfresco.error.AlfrescoRuntimeException {
|
||||
- MESSAGE_DELIMITER : c String
|
||||
- errorCounter : c AtomicInteger
|
||||
- msgId : c String
|
||||
- msgParams : c Object;
|
||||
- serialVersionUID : long
|
||||
--
|
||||
+ AlfrescoRuntimeException(c String)
|
||||
+ AlfrescoRuntimeException(c String, c Object;)
|
||||
+ AlfrescoRuntimeException(c String, c Object;, c Throwable)
|
||||
+ AlfrescoRuntimeException(c String, c Throwable)
|
||||
+ create(c String, c Object;) : AlfrescoRuntimeException
|
||||
+ create(c Throwable, c String, c Object;) : AlfrescoRuntimeException
|
||||
+ getMsgId() : String
|
||||
+ getMsgParams() : Object;
|
||||
+ getNumericalId() : String
|
||||
+ getRootCause() : Throwable
|
||||
+ makeRuntimeException(c Throwable, c String, c Object;) : RuntimeException
|
||||
- buildErrorLogNumber(c String) : String
|
||||
- padInt(c StringBuilder, int, int) : void
|
||||
- resolveMessage(c String, c Object;) : String
|
||||
|
||||
}
|
||||
class org.alfresco.service.cmr.security.NoSuchPersonException {
|
||||
- serialVersionUID : long
|
||||
- userName : c String
|
||||
--
|
||||
+ NoSuchPersonException(c String)
|
||||
+ getUserName() : String
|
||||
|
||||
}
|
||||
interface org.alfresco.service.cmr.security.OwnableService {
|
||||
+ NO_OWNER : c String
|
||||
--
|
||||
+ getOwner(c NodeRef) : String
|
||||
+ hasOwner(c NodeRef) : boolean
|
||||
+ setOwner(c NodeRef, c String) : void
|
||||
+ takeOwnership(c NodeRef) : void
|
||||
|
||||
}
|
||||
class org.alfresco.service.cmr.security.PersonService$PersonInfo {
|
||||
- firstName : c String
|
||||
- lastName : c String
|
||||
- nodeRef : c NodeRef
|
||||
- userName : c String
|
||||
--
|
||||
+ PersonService$PersonInfo(c NodeRef, c String, c String, c String)
|
||||
+ getFirstName() : String
|
||||
+ getLastName() : String
|
||||
+ getNodeRef() : NodeRef
|
||||
+ getUserName() : String
|
||||
|
||||
}
|
||||
enum org.alfresco.service.cmr.security.AccessStatus {
|
||||
+ ALLOWED : c AccessStatus
|
||||
+ DENIED : c AccessStatus
|
||||
+ UNDETERMINED : c AccessStatus
|
||||
--
|
||||
- AccessStatus()
|
||||
+ valueOf(c String) : AccessStatus
|
||||
+ values() : AccessStatus;
|
||||
|
||||
}
|
||||
interface org.alfresco.service.cmr.security.AuthenticationService {
|
||||
--
|
||||
+ authenticate(c String, class [C) : void
|
||||
+ authenticateAsGuest() : void
|
||||
+ authenticationExists(c String) : boolean
|
||||
+ clearCurrentSecurityContext() : void
|
||||
+ getAuthenticationEnabled(c String) : boolean
|
||||
+ getCurrentTicket() : String
|
||||
+ getCurrentUserName() : String
|
||||
+ getDefaultAdministratorUserNames() : Set
|
||||
+ getDefaultGuestUserNames() : Set
|
||||
+ getDomains() : Set
|
||||
+ getDomainsThatAllowUserCreation() : Set
|
||||
+ getDomainsThatAllowUserDeletion() : Set
|
||||
+ getDomiansThatAllowUserPasswordChanges() : Set
|
||||
+ getNewTicket() : String
|
||||
+ guestUserAuthenticationAllowed() : boolean
|
||||
+ invalidateTicket(c String) : void
|
||||
+ invalidateUserSession(c String) : void
|
||||
+ isCurrentUserTheSystemUser() : boolean
|
||||
+ validate(c String) : void
|
||||
|
||||
}
|
||||
interface org.alfresco.service.cmr.security.AuthorityService {
|
||||
+ ZONE_APP_DEFAULT : c String
|
||||
+ ZONE_APP_SHARE : c String
|
||||
+ ZONE_AUTH_ALFRESCO : c String
|
||||
+ ZONE_AUTH_EXT_PREFIX : c String
|
||||
--
|
||||
+ addAuthority( Collection< String>, c String) : void
|
||||
+ addAuthority(c String, c String) : void
|
||||
+ addAuthorityToZones(c String, Set< String>) : void
|
||||
+ authorityExists(c String) : boolean
|
||||
+ countGroups() : long
|
||||
+ countUsers() : long
|
||||
+ createAuthority(c AuthorityType, c String) : String
|
||||
+ createAuthority(c AuthorityType, c String, c String, Set< String>) : String
|
||||
+ deleteAuthority(c String) : void
|
||||
+ deleteAuthority(c String, boolean) : void
|
||||
+ findAuthorities(c AuthorityType, c String, boolean, c String, c String) : Set
|
||||
+ getAllAuthorities(c AuthorityType) : Set
|
||||
+ getAllAuthoritiesInZone(c String, c AuthorityType) : Set
|
||||
+ getAllRootAuthorities(c AuthorityType) : Set
|
||||
+ getAllRootAuthoritiesInZone(c String, c AuthorityType) : Set
|
||||
+ getAuthorities() : Set
|
||||
+ getAuthorities(c AuthorityType, c String, c String, boolean, boolean, c PagingRequest) : PagingResults
|
||||
+ getAuthoritiesForUser(c String) : Set
|
||||
+ getAuthoritiesInfo(c AuthorityType, c String, c String, c String, boolean, c PagingRequest) : PagingResults
|
||||
+ getAuthorityDisplayName(c String) : String
|
||||
+ getAuthorityNodeRef(c String) : NodeRef
|
||||
+ getAuthorityZones(c String) : Set
|
||||
+ getContainedAuthorities(c AuthorityType, c String, boolean) : Set
|
||||
+ getContainingAuthorities(c AuthorityType, c String, boolean) : Set
|
||||
+ getContainingAuthoritiesInZone(c AuthorityType, c String, c String, i AuthorityService$AuthorityFilter, int) : Set
|
||||
+ getDefaultZones() : Set
|
||||
+ getName(c AuthorityType, c String) : String
|
||||
+ getOrCreateZone(c String) : NodeRef
|
||||
+ getShortName(c String) : String
|
||||
+ getZone(c String) : NodeRef
|
||||
+ hasAdminAuthority() : boolean
|
||||
+ hasGuestAuthority() : boolean
|
||||
+ isAdminAuthority(c String) : boolean
|
||||
+ isGuestAuthority(c String) : boolean
|
||||
+ removeAuthority(c String, c String) : void
|
||||
+ removeAuthorityFromZones(c String, Set< String>) : void
|
||||
+ setAuthorityDisplayName(c String, c String) : void
|
||||
|
||||
}
|
||||
enum org.alfresco.service.cmr.security.AuthorityType {
|
||||
+ ADMIN : c AuthorityType
|
||||
+ EVERYONE : c AuthorityType
|
||||
+ GROUP : c AuthorityType
|
||||
+ GUEST : c AuthorityType
|
||||
+ OWNER : c AuthorityType
|
||||
+ ROLE : c AuthorityType
|
||||
+ USER : c AuthorityType
|
||||
+ WILDCARD : c AuthorityType
|
||||
--
|
||||
- AuthorityType()
|
||||
+ equals(c String) : boolean
|
||||
+ getAuthorityType(c String) : AuthorityType
|
||||
+ getFixedString() : String
|
||||
+ getOrderPosition() : int
|
||||
+ getPrefixString() : String
|
||||
+ isFixedString() : boolean
|
||||
+ isPrefixed() : boolean
|
||||
+ valueOf(c String) : AuthorityType
|
||||
+ values() : AuthorityType;
|
||||
|
||||
}
|
||||
interface org.alfresco.service.cmr.security.PersonService {
|
||||
--
|
||||
+ countPeople() : int
|
||||
+ createMissingPeople() : boolean
|
||||
+ createPerson( Map< QName, Serializable>) : NodeRef
|
||||
+ createPerson( Map< QName, Serializable>, Set< String>) : NodeRef
|
||||
+ deletePerson(c NodeRef) : void
|
||||
+ deletePerson(c NodeRef, boolean) : void
|
||||
+ deletePerson(c String) : void
|
||||
+ getAllPeople() : Set
|
||||
+ getMutableProperties() : Set
|
||||
+ getPeople( List< Pair< QName, String>>, boolean, List< Pair< QName, Boolean>>, c PagingRequest) : PagingResults
|
||||
+ getPeople(c String, List< QName>, List< Pair< QName, Boolean>>, c PagingRequest) : PagingResults
|
||||
+ getPeople(c String, List< QName>, Set< QName>, Set< QName>, boolean, List< Pair< QName, Boolean>>, c PagingRequest) : PagingResults
|
||||
+ getPeopleContainer() : NodeRef
|
||||
+ getPeopleFilteredByProperty(c QName, i Serializable, int) : Set
|
||||
+ getPerson(c NodeRef) : PersonService$PersonInfo
|
||||
+ getPerson(c String) : NodeRef
|
||||
+ getPerson(c String, boolean) : NodeRef
|
||||
+ getPersonOrNull(c String) : NodeRef
|
||||
+ getUserIdentifier(c String) : String
|
||||
+ getUserNamesAreCaseSensitive() : boolean
|
||||
+ isEnabled(c String) : boolean
|
||||
+ isMutable() : boolean
|
||||
+ notifyPerson(c String, c String) : void
|
||||
+ personExists(c String) : boolean
|
||||
+ setCreateMissingPeople(boolean) : void
|
||||
+ setPersonProperties(c String, Map< QName, Serializable>) : void
|
||||
+ setPersonProperties(c String, Map< QName, Serializable>, boolean) : void
|
||||
|
||||
}
|
||||
interface org.alfresco.service.cmr.security.PublicServiceAccessService {
|
||||
--
|
||||
+ hasAccess(c String, c String, c Object;) : AccessStatus
|
||||
|
||||
}
|
||||
interface org.alfresco.service.cmr.security.MutableAuthenticationService {
|
||||
--
|
||||
+ createAuthentication(c String, class [C) : void
|
||||
+ deleteAuthentication(c String) : void
|
||||
+ isAuthenticationCreationAllowed() : boolean
|
||||
+ isAuthenticationMutable(c String) : boolean
|
||||
+ setAuthentication(c String, class [C) : void
|
||||
+ setAuthenticationEnabled(c String, boolean) : void
|
||||
+ updateAuthentication(c String, class [C, class [C) : void
|
||||
|
||||
}
|
||||
class org.alfresco.service.cmr.security.PermissionContext {
|
||||
- additionalContext : Map< String, Object>
|
||||
- aspects : HashSet< QName>
|
||||
- dynamicAuthorityAssignment : Map< String, Set< String>>
|
||||
- properties : Map< QName, Serializable>
|
||||
- storeAcl : c Long
|
||||
- type : c QName
|
||||
--
|
||||
+ PermissionContext(c QName)
|
||||
+ addDynamicAuthorityAssignment(c String, c String) : void
|
||||
+ getAdditionalContext() : Map
|
||||
+ getAspects() : HashSet
|
||||
+ getDynamicAuthorityAssignment() : Map
|
||||
+ getProperties() : Map
|
||||
+ getStoreAcl() : Long
|
||||
+ getType() : QName
|
||||
+ setStoreAcl(c Long) : void
|
||||
|
||||
}
|
||||
interface org.alfresco.repo.security.permissions.PermissionCheckValue {
|
||||
--
|
||||
+ getNodeRef() : NodeRef
|
||||
|
||||
}
|
||||
interface org.alfresco.service.cmr.security.PermissionService {
|
||||
+ ADD_CHILDREN : c String
|
||||
+ ADMINISTRATOR_AUTHORITY : c String
|
||||
+ ALL_AUTHORITIES : c String
|
||||
+ ALL_PERMISSIONS : c String
|
||||
+ ASPECTS : c String
|
||||
+ CANCEL_CHECK_OUT : c String
|
||||
+ CHANGE_PERMISSIONS : c String
|
||||
+ CHECK_IN : c String
|
||||
+ CHECK_OUT : c String
|
||||
+ CONSUMER : c String
|
||||
+ CONTRIBUTOR : c String
|
||||
+ COORDINATOR : c String
|
||||
+ CREATE_ASSOCIATIONS : c String
|
||||
+ CREATE_CHILDREN : c String
|
||||
+ DELETE : c String
|
||||
+ DELETE_ASSOCIATIONS : c String
|
||||
+ DELETE_CHILDREN : c String
|
||||
+ DELETE_NODE : c String
|
||||
+ EDITOR : c String
|
||||
+ EXECUTE : c String
|
||||
+ EXECUTE_CONTENT : c String
|
||||
+ FULL_CONTROL : c String
|
||||
+ GROUP_PREFIX : c String
|
||||
+ GUEST_AUTHORITY : c String
|
||||
+ LINK_CHILDREN : c String
|
||||
+ LOCK : c String
|
||||
+ LOCK_OWNER_AUTHORITY : c String
|
||||
+ OWNER_AUTHORITY : c String
|
||||
+ PROPERTIES : c String
|
||||
+ READ : c String
|
||||
+ READ_ASSOCIATIONS : c String
|
||||
+ READ_CHILDREN : c String
|
||||
+ READ_CONTENT : c String
|
||||
+ READ_PERMISSIONS : c String
|
||||
+ READ_PROPERTIES : c String
|
||||
+ ROLE_PREFIX : c String
|
||||
+ SET_OWNER : c String
|
||||
+ TAKE_OWNERSHIP : c String
|
||||
+ UNLOCK : c String
|
||||
+ WRITE : c String
|
||||
+ WRITE_CONTENT : c String
|
||||
+ WRITE_PROPERTIES : c String
|
||||
--
|
||||
+ clearPermission(c NodeRef, c String) : void
|
||||
+ clearPermission(c StoreRef, c String) : void
|
||||
+ deletePermission(c NodeRef, c String, c String) : void
|
||||
+ deletePermission(c StoreRef, c String, c String) : void
|
||||
+ deletePermissions(c NodeRef) : void
|
||||
+ deletePermissions(c StoreRef) : void
|
||||
+ getAllAuthorities() : String
|
||||
+ getAllPermission() : String
|
||||
+ getAllSetPermissions(c NodeRef) : Set
|
||||
+ getAllSetPermissions(c StoreRef) : Set
|
||||
+ getAuthorisations() : Set
|
||||
+ getInheritParentPermissions(c NodeRef) : boolean
|
||||
+ getOwnerAuthority() : String
|
||||
+ getPermissions(c NodeRef) : Set
|
||||
+ getReaders(c Long) : Set
|
||||
+ getReadersDenied(c Long) : Set
|
||||
+ getSettablePermissions(c NodeRef) : Set
|
||||
+ getSettablePermissions(c QName) : Set
|
||||
+ hasPermission(c Long, c PermissionContext, c String) : AccessStatus
|
||||
+ hasPermission(c NodeRef, c String) : AccessStatus
|
||||
+ hasReadPermission(c NodeRef) : AccessStatus
|
||||
+ setInheritParentPermissions(c NodeRef, boolean) : void
|
||||
+ setInheritParentPermissions(c NodeRef, boolean, boolean) : void
|
||||
+ setPermission(c NodeRef, c String, c String, boolean) : void
|
||||
+ setPermission(c StoreRef, c String, c String, boolean) : void
|
||||
|
||||
}
|
||||
interface org.alfresco.service.cmr.security.AuthorityService$AuthorityFilter {
|
||||
--
|
||||
+ includeAuthority(c String) : boolean
|
||||
|
||||
}
|
||||
interface org.alfresco.service.cmr.security.AccessPermission {
|
||||
--
|
||||
+ getAccessStatus() : AccessStatus
|
||||
+ getAuthority() : String
|
||||
+ getAuthorityType() : AuthorityType
|
||||
+ getPermission() : String
|
||||
+ getPosition() : int
|
||||
+ isInherited() : boolean
|
||||
+ isSetDirectly() : boolean
|
||||
|
||||
}
|
||||
class org.alfresco.repo.security.person.PersonException {
|
||||
- serialVersionUID : long
|
||||
--
|
||||
+ PersonException(c String)
|
||||
+ PersonException(c String, c Object;)
|
||||
+ PersonException(c String, c Object;, c Throwable)
|
||||
+ PersonException(c String, c Throwable)
|
||||
|
||||
}
|
||||
|
||||
' Relations
|
||||
|
||||
org.alfresco.service.cmr.security.PersonService$PersonInfo "1" o-left- "1" org.alfresco.service.cmr.repository.NodeRef : nodeRef: c NodeRef
|
||||
org.alfresco.error.AlfrescoRuntimeException "1" o-left- "1" java.util.concurrent.atomic.AtomicInteger : errorCounter: c AtomicInteger
|
||||
org.alfresco.service.cmr.security.PermissionContext "1" o-left- "*" org.alfresco.service.namespace.QName : aspects: HashSet< QName>
|
||||
org.alfresco.service.cmr.security.PermissionContext "1" o-left- "1" org.alfresco.service.namespace.QName : type: c QName
|
||||
org.alfresco.service.cmr.security.PermissionContext "1" o-left- "*" org.alfresco.service.namespace.QName : properties: Map< QName, Serializable>
|
||||
org.alfresco.repo.security.person.PersonException -up|> org.alfresco.error.AlfrescoRuntimeException
|
||||
org.alfresco.service.cmr.security.NoSuchPersonException -up|> org.alfresco.repo.security.person.PersonException
|
||||
org.alfresco.service.cmr.security.MutableAuthenticationService ..up|> org.alfresco.service.cmr.security.AuthenticationService
|
||||
org.alfresco.service.cmr.security.PersonService$PersonInfo ..up|> org.alfresco.repo.security.permissions.PermissionCheckValue
|
||||
|
||||
' Notes
|
||||
|
||||
@enduml
|
8
repository/docs/infrastructure/README.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# Repository -> Infrastructure
|
||||
|
||||
## Sub-components
|
||||
|
||||
* [ ] [Module Framework](./module-framework)
|
||||
* [ ] [Cluster](./cluster)
|
||||
* [ ] [Policies and Behaviours](./policies-and-behaviours)
|
||||
* [ ] [Multi-tenancy](./multi-tenancy)
|
After Width: | Height: | Size: 18 KiB |
@@ -0,0 +1,30 @@
|
||||
@startuml
|
||||
|
||||
title Tenant Service (aws)
|
||||
|
||||
|
||||
|
||||
interface TenantService
|
||||
interface TenantServiceSPI
|
||||
|
||||
class Tenant
|
||||
class TenantServiceDDBImpl
|
||||
class TenantServiceImpl
|
||||
class TenantServiceLambda
|
||||
|
||||
|
||||
Tenant <.. TenantService : uses
|
||||
Tenant <.. TenantServiceDDBImpl : uses
|
||||
Tenant <.. TenantServiceImpl : uses
|
||||
Tenant <.. TenantServiceSPI : uses
|
||||
TenantServiceDDBImpl <.. TenantServiceLambda : uses
|
||||
TenantServiceImpl <.. TenantServiceLambda : uses
|
||||
TenantServiceSPI <.. TenantServiceImpl : uses
|
||||
TenantServiceSPI <.. TenantServiceLambda : uses
|
||||
|
||||
TenantService <|.. TenantServiceImpl : implements
|
||||
TenantServiceSPI <|.. TenantServiceDDBImpl : implements
|
||||
|
||||
center footer © 2016 Alfresco Software Inc. all rights reserved \n Generated from PlantUML
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 68 KiB |
@@ -0,0 +1,89 @@
|
||||
@startuml
|
||||
left to right direction
|
||||
|
||||
|
||||
interface com.alfresco.services.lambda.TenantServiceSPI {
|
||||
--
|
||||
+ createTenant(c String, c String) : Tenant
|
||||
+ deleteTenant(c String) : boolean
|
||||
+ getTenant(c String) : Tenant
|
||||
+ getTenantSchema(c String) : String
|
||||
+ updateTenant(c Tenant) : boolean
|
||||
|
||||
}
|
||||
interface com.alfresco.services.lambda.TenantService {
|
||||
--
|
||||
+ createTenant(c String, c String) : Tenant
|
||||
+ deleteTenant(c String) : boolean
|
||||
+ getTenant(c String) : Tenant
|
||||
+ getTenantSchema(c String) : String
|
||||
+ updateTenant(c Tenant) : boolean
|
||||
|
||||
}
|
||||
class com.alfresco.services.lambda.TenantServiceDDBImpl {
|
||||
- regions : c Regions
|
||||
- tableName : c String
|
||||
--
|
||||
+ TenantServiceDDBImpl()
|
||||
+ createTenant(c String, c String) : Tenant
|
||||
+ deleteTenant(c String) : boolean
|
||||
+ getTenant(c String) : Tenant
|
||||
+ getTenantSchema(c String) : String
|
||||
+ updateTenant(c Tenant) : boolean
|
||||
- log(c String) : void
|
||||
|
||||
}
|
||||
class com.alfresco.services.lambda.TenantServiceLambda {
|
||||
--
|
||||
+ TenantServiceLambda()
|
||||
+ handleRequest(c Tenant, i Context) : Tenant
|
||||
|
||||
}
|
||||
class com.alfresco.services.lambda.TenantServiceImpl {
|
||||
- tenantServiceSPI : i TenantServiceSPI
|
||||
--
|
||||
+ TenantServiceImpl(i TenantServiceSPI)
|
||||
+ createTenant(c String, c String) : Tenant
|
||||
+ deleteTenant(c String) : boolean
|
||||
+ getTenant(c String) : Tenant
|
||||
+ getTenantSchema(c String) : String
|
||||
+ updateTenant(c Tenant) : boolean
|
||||
|
||||
}
|
||||
class com.alfresco.services.lambda.Tenant {
|
||||
- method : c String
|
||||
- schema : c String
|
||||
- spiProvider : c String
|
||||
- tenantId : c String
|
||||
- user : c String
|
||||
--
|
||||
+ Tenant()
|
||||
+ getMethod() : String
|
||||
+ getSchema() : String
|
||||
+ getSpiProvider() : String
|
||||
+ getTenantId() : String
|
||||
+ getUser() : String
|
||||
+ setMethod(c String) : void
|
||||
+ setSchema(c String) : void
|
||||
+ setSpiProvider(c String) : void
|
||||
+ setTenantId(c String) : void
|
||||
+ setUser(c String) : void
|
||||
|
||||
}
|
||||
interface com.amazonaws.services.lambda.runtime.RequestHandler <I extends c Object, O extends c Object> {
|
||||
--
|
||||
+ handleRequest(I, i Context) : Object
|
||||
|
||||
}
|
||||
|
||||
' Relations
|
||||
|
||||
com.alfresco.services.lambda.TenantServiceImpl "1" o-left- "1" com.alfresco.services.lambda.TenantServiceSPI : tenantServiceSPI: i TenantServiceSPI
|
||||
com.alfresco.services.lambda.TenantServiceDDBImpl "1" o-left- "1" com.amazonaws.regions.Regions : regions: c Regions
|
||||
com.alfresco.services.lambda.TenantServiceImpl ..up|> com.alfresco.services.lambda.TenantService
|
||||
com.alfresco.services.lambda.TenantServiceDDBImpl ..up|> com.alfresco.services.lambda.TenantServiceSPI
|
||||
com.alfresco.services.lambda.TenantServiceLambda ..up|> com.amazonaws.services.lambda.runtime.RequestHandler
|
||||
|
||||
' Notes
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 36 KiB |
@@ -0,0 +1,51 @@
|
||||
@startuml
|
||||
|
||||
title Tenant Component (nosql)
|
||||
|
||||
skinparam linetype ortho
|
||||
|
||||
interface ApiConstants
|
||||
interface TenantService
|
||||
interface TenantServiceSPI
|
||||
|
||||
class AbstractRestResource {
|
||||
#switchTenant()
|
||||
}
|
||||
class AbstractServiceClient
|
||||
class An2ApiException
|
||||
class CreateTenantPojo
|
||||
class Cx1TenantService
|
||||
class GetTenantPojo
|
||||
class InitializingBean
|
||||
class NoSuchTenantException
|
||||
class TenantExistsException
|
||||
class TenantService
|
||||
class TenantServiceClient
|
||||
class TenantServiceImpl
|
||||
class TenantServiceIT
|
||||
class TenantServiceRestV1
|
||||
class VersionCheckException
|
||||
|
||||
|
||||
AbstractRestResource <|-- TenantServiceRestV1 : extends
|
||||
AbstractServiceClient <|-- TenantServiceClient : extends
|
||||
An2ApiException <|-- NoSuchTenantException : extends
|
||||
An2ApiException <|-- TenantExistsException : extends
|
||||
An2ApiException <|-- VersionCheckException : extends
|
||||
ApiConstants <|.. TenantServiceImpl : uses
|
||||
CreateTenantPojo <.. TenantServiceClient : uses
|
||||
CreateTenantPojo <.. TenantServiceRestV1 : uses
|
||||
GetTenantPojo <.. TenantServiceClient : uses
|
||||
GetTenantPojo <.. TenantServiceRestV1 : uses
|
||||
InitializingBean <|.. TenantServiceImpl : implements
|
||||
NoSuchTenantException <.. AbstractRestResource : uses
|
||||
TenantService <.. AbstractRestResource : uses
|
||||
TenantService <|.. TenantServiceClient : implements
|
||||
TenantService <|.. TenantServiceImpl : implements
|
||||
TenantService <|.. TenantServiceRestV1 : uses
|
||||
TenantServiceClient <.. TenantServiceIT : uses
|
||||
TenantServiceSPI <.. Cx1TenantService : implements
|
||||
TenantServiceSPI <.. TenantServiceImpl : uses
|
||||
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 36 KiB |
@@ -0,0 +1,39 @@
|
||||
@startuml
|
||||
|
||||
title Tenant Service (nosql)
|
||||
|
||||
skinparam linetype ortho
|
||||
|
||||
node "Service\nClient" as SC #E0F2F1
|
||||
|
||||
node "API Gateway" as APIG #EEEEEE {
|
||||
|
||||
node "/tenants Resource" as TR #EFEBE9 {
|
||||
node "method POST" as POST #FBE9E7 {
|
||||
node "POST \nbody mapping template" #DCEDC8
|
||||
}
|
||||
node "method PUT" as PUT #FBE9E7{
|
||||
node "PUT \nbody mapping template" #DCEDC8
|
||||
}
|
||||
node "method GET" as GET #FBE9E7
|
||||
node "method DELETE" As DELETE #FBE9E7
|
||||
}
|
||||
}
|
||||
node "Tenant Service \nLambda Function" as L #FFD54F
|
||||
|
||||
database "DynamoDB Database\nalf-data-tenants" as DB #80D8FF
|
||||
|
||||
node "DynamoDB\nClient" As DDBC #B3E5FC
|
||||
|
||||
node "DynamoDB" As DDB #B2EBF2
|
||||
|
||||
SC->TR:https
|
||||
POST->L:JSON
|
||||
PUT->L:JSON
|
||||
GET->L:URL {tenant-id}
|
||||
DELETE->L:URL {tenant-id}
|
||||
L->DDBC
|
||||
DDBC->DDB:reads/writes
|
||||
DDB->DB:reads/writes
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 65 KiB |
@@ -0,0 +1,86 @@
|
||||
@startuml
|
||||
|
||||
Title Tenant Deployment\nDesign Options
|
||||
|
||||
skinparam nodeBorderColor black
|
||||
|
||||
left to right direction
|
||||
|
||||
node "AWS" as 2G #EEEEEE {
|
||||
node "Tenant\nService" as 2T #white
|
||||
node "Alfresco\nControl Architecture" as 2CA #white
|
||||
node "Customer A" as 2C1 #FFCDD2 {
|
||||
node "Alfresco 5.1" as 2A1 #E6EE9C {
|
||||
node "Tenant" as 2T1
|
||||
}
|
||||
}
|
||||
node "Customer B" as 2C2 #FFCDD2{
|
||||
node "Alfresco 5.1" as 2A2 #E6EE9C {
|
||||
node "Tenant" as 2T2
|
||||
}
|
||||
}
|
||||
node "Customer C" as 2C3 #FFCDD2{
|
||||
node "Alfresco 5.1" as 2A3 #E6EE9C {
|
||||
node "Tenant" as 2T3
|
||||
}
|
||||
}
|
||||
node "Customers D and E" as CDE #FFCDD2{
|
||||
node "Repository Next" as 2B #B3E5FC
|
||||
node "Tenant\n(Customer D)" as 2CD
|
||||
node "Tenant\n(Customer E)" as 2CE
|
||||
}
|
||||
}
|
||||
|
||||
2CA=>2C1
|
||||
2CA=>2C2
|
||||
2CA=>2C3
|
||||
2CA=>CDE
|
||||
2CA=>2T
|
||||
2T=>2CD
|
||||
2T=>2CE
|
||||
2B=>2T
|
||||
|
||||
node "AWS" as G #EEEEEE {
|
||||
node "Alfresco\nControl Architecture" as CA #white
|
||||
node "Customer A" as C1 #FFCDD2 {
|
||||
node "Alfresco 5.1" as A1 #E6EE9C {
|
||||
node "Tenant" as T1
|
||||
}
|
||||
}
|
||||
node "Customer B" as C2 #FFCDD2{
|
||||
node "Alfresco 5.1" as A2 #E6EE9C {
|
||||
node "Tenant" as T2
|
||||
}
|
||||
}
|
||||
node "Customer C" as C3 #FFCDD2{
|
||||
node "Alfresco 5.1" as A3 #E6EE9C {
|
||||
node "Tenant" as T3
|
||||
}
|
||||
}
|
||||
node "Customer D" as C4 #FFCDD2 {
|
||||
node "Tenant\nService" as TC1 #white
|
||||
node "Tenant" as T5
|
||||
node "Repository Next" as B1 #B3E5FC
|
||||
}
|
||||
node "Customer E" as C5 #FFCDD2 {
|
||||
node "Tenant\nService" as TC2 #white
|
||||
node "Tenant" as T6
|
||||
node "Tenant" as T7
|
||||
node "Tenant" as T8
|
||||
node "Repository Next" as B2 #B3E5FC
|
||||
}
|
||||
}
|
||||
|
||||
TC1=>T5
|
||||
TC2=>T6
|
||||
TC2=>T7
|
||||
TC2=>T8
|
||||
CA=>C1
|
||||
CA=>C2
|
||||
CA=>C3
|
||||
CA=>C4
|
||||
CA=>C5
|
||||
B2=>TC2
|
||||
B1=>TC1
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 77 KiB |
@@ -0,0 +1,69 @@
|
||||
@startuml
|
||||
|
||||
Title: Create a Tenant (NoSQL - AWS)
|
||||
actor "User" as U
|
||||
participant "Tenant Console" as TC
|
||||
participant "API Gateway" as APIG
|
||||
participant "TenantServiceLambda" as TSL
|
||||
participant "TenantServiceImpl" as TSI
|
||||
participant "DDbTenantService" as DDTS
|
||||
participant "Dynamo DB Client" as DDBC
|
||||
database "DynamoDB" as DDB
|
||||
|
||||
U->TC:create Tenant
|
||||
note right
|
||||
What the Tenant Console
|
||||
is is TBD. It
|
||||
may be part of the
|
||||
AWS Control Architecture
|
||||
or a Beowulf Admin
|
||||
Console
|
||||
end note
|
||||
activate TC
|
||||
TC->APIG: HTTP POST {<API Gateway host:port>/public/an2/v1/tenants\nTenant Object(JSON)
|
||||
activate APIG
|
||||
APIG->TSL: handler(serialized Tenant Object(JSON))
|
||||
note right
|
||||
The HTTP Verb and UserInfo is
|
||||
passed to the Tenant Service
|
||||
Lambda in the JSON object.
|
||||
Tenant Service Lambda selects
|
||||
the TenantServiceImpl method
|
||||
to call based on the HTTP Verb
|
||||
end note
|
||||
activate TSL
|
||||
TSL->TSI: createTenant()
|
||||
note right
|
||||
Unsolved Design Challenge #1:
|
||||
How to supply a configuration
|
||||
to allow alternative
|
||||
implementations at
|
||||
runtime. In current
|
||||
form, the TenantServiceSPI
|
||||
passed to TenantServiceImpl
|
||||
is set in an API Gateway
|
||||
template. That would allow
|
||||
us to specify a different
|
||||
provider of the SPI using,
|
||||
for example, an HTTP parm
|
||||
end note
|
||||
activate TSI
|
||||
TSI->DDTS
|
||||
activate DDTS
|
||||
DDTS->DDBC: table.putItem(new Item().withPrimaryKey("tenant-id")
|
||||
activate DDBC
|
||||
DDBC->DDB: store the tenant record
|
||||
DDB->DDBC: success
|
||||
deactivate DDB
|
||||
DDBC->DDTS:success
|
||||
deactivate DDBC
|
||||
DDTS->TSI:success
|
||||
deactivate DDTS
|
||||
TSI->TSL: success
|
||||
deactivate TSI
|
||||
TSL->TC: HTTP 200 OK
|
||||
deactivate TSL
|
||||
TC->>U:success message
|
||||
deactivate TC
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 60 KiB |
@@ -0,0 +1,60 @@
|
||||
@startuml
|
||||
|
||||
Title: Create a Tenant (NoSQL)
|
||||
actor "User" as U
|
||||
participant "Tenant Console" as TC
|
||||
participant "TenantServiceClient" as TCL
|
||||
participant "TenantServiceRestV1" as TRS
|
||||
participant "TenantServiceImpl" as TSI
|
||||
participant "Cx1TenantService" as CTS
|
||||
participant "cassandra-driver-core-2.2.0-rc1" as DDC
|
||||
database "Cassandra" as C
|
||||
|
||||
U->TC:create Tenant
|
||||
note right
|
||||
The Tenant Console
|
||||
may be part of the
|
||||
Admin Console
|
||||
end note
|
||||
activate TC
|
||||
TC->TCL:createTenant()
|
||||
activate TCL
|
||||
TCL->TCL: find server from super\nAbstractServiceClient
|
||||
TCL->TRS: HTTP POST {tenantCtx}/public/an2/v1/tenants\nCreateTenantPojo(JSON)
|
||||
activate TRS
|
||||
note right
|
||||
This is wired
|
||||
to the endpoint
|
||||
using Jersey
|
||||
end note
|
||||
TRS->TSI: create(TenantServiceSPI=Cx1TenantService)
|
||||
activate TSI
|
||||
TSI->CTS: createTenant()
|
||||
note right
|
||||
The Cassandra
|
||||
implementation can
|
||||
be replaced by
|
||||
other implementations
|
||||
(e.g. Dynamo DB)
|
||||
through Spring config
|
||||
end note
|
||||
activate CTS
|
||||
CTS->DDC: insert into Table alf_data_tenants
|
||||
activate DDC
|
||||
DDC->C: store the tenant record
|
||||
C->DDC:success
|
||||
deactivate C
|
||||
DDC->CTS: success
|
||||
deactivate DDC
|
||||
CTS->TSI:success
|
||||
deactivate CTS
|
||||
TSI->TRS: success
|
||||
deactivate TSI
|
||||
TRS->TCL: HTTP 200 OK
|
||||
deactivate TRS
|
||||
TCL->TC: success
|
||||
deactivate TCL
|
||||
TC->>U:success message
|
||||
deactivate TC
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 79 KiB |
@@ -0,0 +1,175 @@
|
||||
@startuml
|
||||
|
||||
title Policies: Policy Component (V4.2 onwards)
|
||||
|
||||
' Split into 2 pages
|
||||
page 2x1
|
||||
|
||||
interface PolicyEndpointService #DDDDDD
|
||||
class PolicyEndpointServiceImpl #DDDDDD implements PolicyEndpointService{
|
||||
- policyComponent : PolicyComponent
|
||||
- policyEndpointRegistry : registry
|
||||
+ registerPolicyEndpoint(QName policy, String endpoint) : void
|
||||
+ registerPolicyEndpoint(QName policy, QName typeOrAspect, String endpoint) : void
|
||||
+ unregisterPolicyEndpoint(QName policy, String endpoint) : void
|
||||
+ unregisterPolicyEndpoint(QName policy, QName typeOrAspect, String endpoint) : void
|
||||
}
|
||||
PolicyEndpointServiceImpl -> PolicyComponent
|
||||
class PolicyEndpointRegistry #DDDDDD {
|
||||
- QueuedBehaviour dynamicBehaviour
|
||||
- Set<PolicyEndPointPolicyEndpoint> registrations
|
||||
+ {static} PolicyEndpointRegistry getInstance()
|
||||
+ reload(long fromTime)
|
||||
+ slip(String body, @Properties Map<String, Object> properties)
|
||||
}
|
||||
PolicyEndpointRegistry *- "1" QueuedBehaviour
|
||||
PolicyEndpointServiceImpl -> PolicyEndpointRegistry
|
||||
class PolicyEndpoint <<immutable>> #DDDDDD {
|
||||
- QName policy
|
||||
- QName typeOrAspect
|
||||
- String endpoint
|
||||
- long modified
|
||||
- boolean active
|
||||
+ getKey()
|
||||
}
|
||||
PolicyEndpointRegistry *- PolicyEndpoint
|
||||
|
||||
|
||||
interface Policy
|
||||
interface ClassPolicy extends Policy
|
||||
interface OnCreateNodePolicy extends ClassPolicy {
|
||||
+QNAME: http://www.alfresco.org:onCreateNode
|
||||
+onCreateNode(ChildAssociationRef childAssocRef)
|
||||
}
|
||||
interface AssociationPolicy extends Policy
|
||||
interface OnCreateChildAssociationPolicy extends AssociationPolicy {
|
||||
+QNAME: http://www.alfresco.org:onCreateChildAssociation
|
||||
+onCreateChildAssociation(ChildAssociationRef childAssocRef, boolean isNewNode)
|
||||
}
|
||||
|
||||
enum NotificationFrequency {
|
||||
EVERY_EVENT,
|
||||
FIRST_EVENT,
|
||||
TRANSACTION_COMMIT
|
||||
}
|
||||
|
||||
interface Behaviour {
|
||||
+ <T> getInterface(Class<T> policy) : T
|
||||
+ disable()
|
||||
+ enable()
|
||||
+ isEnabled() : boolean
|
||||
+ getNotificationFrequency() : NotificationFrequency
|
||||
}
|
||||
class BaseBehaviour implements Behaviour {
|
||||
# proxies : Map<Class, Object>
|
||||
# frequency : NotificationFrequency
|
||||
- disabled : StackThreadLocal
|
||||
+ disable()
|
||||
+ enable()
|
||||
+ isEnabled() : boolean
|
||||
+ getNotificationFrequency() : NotificationFrequency
|
||||
}
|
||||
class JavaBehaviour extends BaseBehaviour {
|
||||
+ <T> getInterface(Class<T> policy) : T
|
||||
# <T> getInvocationHandler(Object instance, String method, Class<T> policyIF) : InvocationHandler
|
||||
}
|
||||
class QueuedBehaviour <<V5.2>> #DDDDDD extends BaseBehaviour {
|
||||
- ProducerTemplate queueTemplate
|
||||
+ <T> getInterface(Class<T> policy) : T
|
||||
# <T> getInvocationHandler(Object instance, String method, Class<T> policyIF) : InvocationHandler
|
||||
}
|
||||
class ScriptBehaviour extends BaseBehaviour
|
||||
BaseBehaviour o- NotificationFrequency
|
||||
|
||||
interface BehaviourBinding {
|
||||
+ generaliseBinding() : BehaviourBinding
|
||||
}
|
||||
class ClassBehaviourBinding implements BehaviourBinding {
|
||||
+ generaliseBinding() : BehaviourBinding
|
||||
}
|
||||
class ClassFeatureBehaviourBinding extends ClassBehaviourBinding {
|
||||
}
|
||||
class ServiceBehaviourBinding implements BehaviourBinding {
|
||||
+ generaliseBinding() : BehaviourBinding
|
||||
}
|
||||
|
||||
class ClassPolicyDelegate<P extends ClassPolicy> {
|
||||
- dictionary : DictionaryService
|
||||
- factory : CachedPolicyFactory<ClassFeatureBehaviourBinding, P>
|
||||
# ClassPolicyDelegate(DictionaryService dictionary, Class<P> policyClass, BehaviourIndex<ClassBehaviourBinding> index, long tryLockTimeout)
|
||||
}
|
||||
class AssociationPolicyDelegate<P extends AssociationPolicy> {
|
||||
- dictionary : DictionaryService
|
||||
- factory : CachedPolicyFactory<ClassFeatureBehaviourBinding, P>
|
||||
# AssociationPolicyDelegate(DictionaryService dictionary, Class<P> policyClass, BehaviourIndex<ClassFeatureBehaviourBinding> index, long tryLockTimeout)
|
||||
}
|
||||
class PropertyPolicyDelegate<P extends PropertyPolicy> {
|
||||
- dictionary : DictionaryService
|
||||
- factory : CachedPolicyFactory<ClassFeatureBehaviourBinding, P>
|
||||
# PropertyPolicyDelegate(DictionaryService dictionary, Class<P> policyClass, BehaviourIndex<ClassFeatureBehaviourBinding> index, long tryLockTimeout)
|
||||
}
|
||||
class PolicyFactory<B extends BehaviourBinding, P extends Policy> {
|
||||
- index : BehaviourIndex~<B>
|
||||
- policyClass : Class~<P>
|
||||
- transactionHandlerFactory : TransactionInvocationHandlerFactory
|
||||
- tenantService : TenantService
|
||||
--
|
||||
PolicyFactory(Class<P> policyClass, BehaviourIndex~<B> index)
|
||||
--
|
||||
}
|
||||
class CachedPolicyFactory<B extends BehaviourBinding, P extends Policy> extends PolicyFactory
|
||||
|
||||
abstract class AbstractNodeServiceImpl implements NodeService {
|
||||
- policyComponent : PolicyComponent
|
||||
# dictionaryService : DictionaryService
|
||||
# transactionService : TransactionService
|
||||
# tenantService : TenantService
|
||||
- onCreateNodeDelegate : ClassPolicyDelegate<OnCreateNodePolicy>
|
||||
}
|
||||
interface PolicyComponent {
|
||||
+ <P extends ClassPolicy> registerClassPolicy(Class<P> policy) : ClassPolicyDelegate<P>
|
||||
+ <P extends PropertyPolicy> registerPropertyPolicy(Class<P> policy) : PropertyPolicyDelegate<P>
|
||||
+ <P extends AssociationPolicy> registerAssociationPolicy(Class<P> policy) : AssociationPolicyDelegate<P>
|
||||
+ bindClassBehaviour(QName policy, QName className, Behaviour behaviour) : BehaviourDefinition<ClassBehaviourBinding>
|
||||
+ bindClassBehaviour(QName policy, Object service, Behaviour behaviour) : BehaviourDefinition<ServiceBehaviourBinding>
|
||||
+ bindPropertyBehaviour(QName policy, QName className, QName propertyName, Behaviour behaviour) : BehaviourDefinition<ClassFeatureBehaviourBinding>
|
||||
+ bindPropertyBehaviour(QName policy, QName className, Behaviour behaviour) : BehaviourDefinition<ClassFeatureBehaviourBinding>
|
||||
+ bindPropertyBehaviour(QName policy, Object service, Behaviour behaviour) : BehaviourDefinition<ServiceBehaviourBinding>
|
||||
+ bindAssociationBehaviour(QName policy, QName className, QName assocName, Behaviour behaviour) : BehaviourDefinition<ClassFeatureBehaviourBinding>
|
||||
+ bindAssociationBehaviour(QName policy, QName className, Behaviour behaviour) : BehaviourDefinition<ClassFeatureBehaviourBinding>
|
||||
+ bindAssociationBehaviour(QName policy, Object service, Behaviour behaviour) : BehaviourDefinition<ServiceBehaviourBinding>
|
||||
+ removeClassDefinition(BehaviourDefinition<ClassBehaviourBinding> definition) : void
|
||||
}
|
||||
class PolicyComponentImpl implements PolicyComponent {
|
||||
- Map<QName, ClassBehaviourIndex<ClassBehaviourBinding>> classBehaviours
|
||||
- Map<QName, ClassBehaviourIndex<ClassFeatureBehaviourBinding>> propertyBehaviours
|
||||
- Map<QName, ClassBehaviourIndex<ClassFeatureBehaviourBinding>> associationBehaviours
|
||||
+ PolicyComponentImpl(DictionaryService dictionary)
|
||||
+ ... (all)
|
||||
}
|
||||
interface BehaviourFilter {
|
||||
+ disableBehaviour() : void
|
||||
+ disableBehaviour(QName className) : void
|
||||
+ disableBehaviour(QName className, boolean includeSubClasses) : void
|
||||
+ disableBehaviour(NodeRef nodeRef, QName className) : void
|
||||
+ disableBehaviour(NodeRef nodeRef) : void
|
||||
+ enableBehaviour() : void
|
||||
+ enableBehaviour(QName className) : void
|
||||
+ enableBehaviour(NodeRef nodeRef, QName className) : void
|
||||
+ enableBehaviour(NodeRef nodeRef) : void
|
||||
}
|
||||
class BehaviourFilterImpl implements BehaviourFilter {
|
||||
+ ... (all)
|
||||
}
|
||||
|
||||
AbstractNodeServiceImpl -> PolicyComponentImpl
|
||||
PolicyComponentImpl -> BehaviourFilterImpl
|
||||
PolicyComponentImpl -> "creates" ClassPolicyDelegate
|
||||
PolicyComponentImpl -> "creates" AssocationPolicyDelegate
|
||||
PolicyComponentImpl -> "creates" PropertyPolicyDelegate
|
||||
ClassPolicyDelegate --> "uses" PolicyFactory
|
||||
AssociationPolicyDelegate --> "uses" PolicyFactory
|
||||
PropertyPolicyDelegate --> "uses" PolicyFactory
|
||||
PolicyFactory --> "creates" BehaviourBinding
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 98 KiB |
After Width: | Height: | Size: 44 KiB |
@@ -0,0 +1,56 @@
|
||||
@startuml
|
||||
|
||||
title Policies: Queued Policies (V5.2 Proposal)
|
||||
|
||||
actor user
|
||||
|
||||
database ActiveMQ as AMQ
|
||||
database DB {
|
||||
folder alf_policies
|
||||
}
|
||||
|
||||
component "Client Application" {
|
||||
component [Client Code]
|
||||
component [ClientQueueReceiver]
|
||||
component [Camel(Client App)]
|
||||
}
|
||||
user <--> [Client Code]
|
||||
ClientQueueReceiver <-- [Camel(Client App)]
|
||||
ClientQueueReceiver -> [Client Code]
|
||||
[Camel(Client App)] <- AMQ
|
||||
|
||||
component "Alfresco One Platform" {
|
||||
component Quartz as Q
|
||||
component [Camel] as Camel
|
||||
|
||||
component [Policy ReST API] as PR
|
||||
component PolicyService as PS {
|
||||
[PolicyCheckJob] as PCJ
|
||||
[PolicyMap] as PM <<Map>>
|
||||
component Routes as R {
|
||||
component ToQueue
|
||||
component FromQueue
|
||||
}
|
||||
}
|
||||
component PolicyComponent as PC {
|
||||
component QueuedBehaviour as QB
|
||||
}
|
||||
component [Alfresco Services] as Services
|
||||
component PolicyDAO as PD
|
||||
}
|
||||
|
||||
[Client Code] <-> PR
|
||||
|
||||
Q --> PCJ
|
||||
PCJ -> PM
|
||||
PR --> PS
|
||||
Services -> PC
|
||||
PCJ --> PD
|
||||
PD -> DB
|
||||
QB -> ToQueue
|
||||
ToQueue -> Camel
|
||||
FromQueue <- Camel
|
||||
FromQueue --> Services
|
||||
Camel <-> AMQ
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 42 KiB |
@@ -0,0 +1,37 @@
|
||||
@startuml
|
||||
|
||||
Title: Policies: Register Policy Endpoint (V5.2 Proposal)
|
||||
|
||||
skinparam componentStyle uml2
|
||||
|
||||
actor "Client App" as Client
|
||||
participant "Policy Endpoint Rest API" as API
|
||||
participant "PolicyEndpointService" as PS
|
||||
participant "PolicyEndpointRegistry" as PER
|
||||
participant "PolicyEndpointDAO" as DAO
|
||||
database DB
|
||||
participant "PolicyComponent" as PC
|
||||
database AMQ
|
||||
|
||||
note over DAO,DB
|
||||
UNIQUE : policy,typeOrAspect,endpoint
|
||||
OTHER : active, modified
|
||||
SORT : modified
|
||||
end note
|
||||
|
||||
Client -> API
|
||||
API -> PS : registerPolicyEndpoint(policy, typeOrAspect, endpoint)
|
||||
PS -> DAO : createPolicyEndpoint(policy, typeOrAspect, endpoint)
|
||||
DAO -> DB : INSERT
|
||||
PS <-- DAO : success
|
||||
PS -> PER : reload(fromTime)
|
||||
PER -> DAO : getPolicyEndpoints(fromTime)
|
||||
loop each policy endpoint registration change
|
||||
PER -> PER
|
||||
end
|
||||
PS <-- PER : success
|
||||
API <-- PS : success
|
||||
Client <-- API : OK
|
||||
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 47 KiB |
@@ -0,0 +1,48 @@
|
||||
@startuml
|
||||
|
||||
Title: Policies: Reload Policy Endpoints (V5.2 Proposal)
|
||||
|
||||
skinparam componentStyle uml2
|
||||
|
||||
participant "Quartz"
|
||||
participant "PolicyCheckJob" as PCJ
|
||||
participant "PolicyEndpointRegistry" as PER
|
||||
participant "QueuedBehaviour" as QB
|
||||
participant "PolicyEndpointDAO" as DAO
|
||||
database DB
|
||||
participant "PolicyComponent" as PC
|
||||
database AMQ
|
||||
|
||||
== Static Route Initialization ==
|
||||
|
||||
activate PER
|
||||
PER -> QB: new
|
||||
activate PER
|
||||
PER -> PER: from("direct:policy")
|
||||
PER -> PER: dynamicRouter(method(PolicyEndpointRegistry.class, "slip"))
|
||||
deactivate PER
|
||||
deactivate PER
|
||||
|
||||
== Quartz ==
|
||||
|
||||
note over DAO,DB
|
||||
UNIQUE : policy,typeOrAspect,endpoint
|
||||
OTHER : active, modified
|
||||
SORT : modified
|
||||
end note
|
||||
|
||||
Quartz -> PCJ
|
||||
PCJ -> PER : reload(fromTime)
|
||||
PER -> DAO : getPolicyEndpoints(fromTime)
|
||||
DAO -> DB: SELECT(fromTime)
|
||||
DAO <-- DB
|
||||
PER <-- DAO
|
||||
loop each policy endpoint registration change
|
||||
PER -> PER: updateRegistrations(PolicyEndpoint)
|
||||
PER -> PC: bindClassBehaviour(policy,typeOrAspect, behaviour)
|
||||
end
|
||||
PCJ <-- PER : success
|
||||
Quartz <-- PCJ : success
|
||||
|
||||
|
||||
@enduml
|
@@ -0,0 +1,11 @@
|
||||
# Node Storage and Retrieval
|
||||
|
||||
## Properties
|
||||
|
||||
### Encrypted properties (```d:encrypted```)
|
||||
Encrypted properties are stored as BLOBs in the database, but there is no additional handling for
|
||||
them. In particular, the ```NodeService``` does not encrypt or decrypt them. It only guarantees
|
||||
that properties of this type contain objects of type ```javax.crypto.SealedObject```. It is up to
|
||||
the implementor of a custom extension to handle encryption.
|
||||
The ACS provides the helper class ```MetadataEncryptor``` which provides key handling and a one-stop-shop
|
||||
for encryption. But custom implementations do not need to use it.
|
118
repository/docs/meta-data-services/versions/README.md
Normal file
@@ -0,0 +1,118 @@
|
||||
|
||||
## Versions
|
||||
|
||||

|
||||
|
||||
### Purpose
|
||||
|
||||
***
|
||||
|
||||
### Overview
|
||||
|
||||
***
|
||||
|
||||
### Artifacts and Guidance
|
||||
|
||||
* Source Code Link:m https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/
|
||||
* License: LGPL
|
||||
* Issue Tracker Link: https://issues.alfresco.com/jira/secure/RapidBoard.jspa?projectKey=REPO&useStoredSettings=true&rapidView=379
|
||||
* Documentation Link: http://docs.alfresco.com/5.1/concepts/versioning.html
|
||||
* Contribution Model: Alfresco publishes the source code and will review proposed patch requests
|
||||
***
|
||||
|
||||
|
||||
### Prerequisite Knowledge
|
||||
|
||||
***
|
||||
|
||||
### Design
|
||||
|
||||
#### Component Model
|
||||
|
||||
#### Data Model
|
||||
|
||||
#### Data Dictionary
|
||||
|
||||
#### Flows
|
||||
|
||||
This is a series of flows illustrating when versions are created, based on changes to content and metadata.
|
||||
|
||||
##### No Autoversion on Property Updates
|
||||
Suppose the defaults in the _cm:versionable_ aspect are set as follows:
|
||||
```
|
||||
version.store.enableAutoVersioning=true
|
||||
version.store.enableAutoVersionOnUpdateProps=false
|
||||
```
|
||||
Note this is the default case when Alfresco is installed.
|
||||
|
||||

|
||||
|
||||
|
||||
##### Autoversion on Property Updates
|
||||
Suppose the defaults in the _cm:versionable_ aspect are set as follows:
|
||||
```
|
||||
version.store.enableAutoVersioning=true
|
||||
version.store.enableAutoVersionOnUpdateProps=true
|
||||
```
|
||||

|
||||
|
||||
|
||||
#### Class Diagram
|
||||
|
||||
***
|
||||
|
||||
### APIs and Interfaces
|
||||
|
||||
***
|
||||
|
||||
### Configuration
|
||||
|
||||
#### What is Versioned
|
||||
Whether an object is versionable at all is governed by the presence of the _cm:versionable_ aspect.
|
||||
If the aspect is present, the object is versioned. Otherwise it is not versioned.
|
||||
|
||||
#### Autoversioning
|
||||
|
||||
Sometimes it is desirable to create a version automatically. Whether this happens is controlled by two variables in the _cm:versionable_ aspect:
|
||||
|
||||
* cm:autoVersion
|
||||
* cm:autoVersionOnUpdateProps
|
||||
|
||||
|
||||
When _cm:autoVersion_ is true, a new version is created when the _cm:content_ of a content node changes.
|
||||
When _cm:autoVersionOnUpdateProps_ is true, a new version is created when any of the properties of a content node change.
|
||||
|
||||
The defaults for these properties are set in the contentModel.xml file in the usual way. But to simplify the admin experience, the values of these properties can also set using global properties:
|
||||
|
||||
* version.store.enableAutoVersioning
|
||||
* version.store.enableAutoVersionOnUpdateProps
|
||||
|
||||
If the values are found in the properties file they have the effect of overriding what may have been set in the contenModel.xml file.
|
||||
|
||||
The effect of these properties can be overridden by Share using a set of two properties:
|
||||
|
||||
* autoVersion
|
||||
* autoVersionProps
|
||||
|
||||
The values of these overrides are contained in the file _upload.post.config.xml_ such as in this example
|
||||
```
|
||||
<autoVersion>true</autoVersion>
|
||||
<autoVersionProps>false</autoVersionProps>
|
||||
```
|
||||
|
||||
***
|
||||
|
||||
### Performance Considerations
|
||||
***
|
||||
|
||||
### Security Considerations
|
||||
***
|
||||
|
||||
### Cloud Considerations
|
||||
None
|
||||
|
||||
***
|
||||
|
||||
### Design Decisions
|
||||
|
||||
***
|
After Width: | Height: | Size: 94 KiB |
@@ -0,0 +1,107 @@
|
||||
@startuml
|
||||
|
||||
Title: Autoversion on Property Update - Versioning Flow
|
||||
|
||||
participant "CMIS Client" as C
|
||||
participant "Repository" as R
|
||||
participant "Version Service" as V
|
||||
participant "workspace://SpacesStore" as SS
|
||||
participant "workspace://version2Store" as VS
|
||||
participant "File System" as FS
|
||||
database "Database" as DB
|
||||
|
||||
C->R:HTTP POST
|
||||
activate R
|
||||
group "transaction"
|
||||
R->V
|
||||
activate V
|
||||
|
||||
V->SS: create node
|
||||
activate SS
|
||||
SS->DB: create node
|
||||
activate DB
|
||||
DB->SS: OK
|
||||
deactivate DB
|
||||
SS->V: OK
|
||||
deactivate SS
|
||||
note right of SS
|
||||
workspace://SpacesStore/6060b6b6-2928-4092-ab66-659a7e68c0f6
|
||||
cm:autoVersionOnUpdateProps=true
|
||||
cm:name=foo.txt
|
||||
cm:versionLabel=1.0
|
||||
end note
|
||||
V->VS: create version history node with one child node
|
||||
activate VS
|
||||
VS->DB: create nodes
|
||||
activate DB
|
||||
DB->VS: OK
|
||||
deactivate DB
|
||||
VS->V: OK
|
||||
deactivate VS
|
||||
note right of VS
|
||||
One Version History Node with one child ...
|
||||
|
||||
workspace://version2Store/62de48fa-6adc-4228-8667-df62584f98de
|
||||
cm:autoVersionOnUpdateProps=true
|
||||
cm:name=foo.txt
|
||||
cm:versionLabel=null
|
||||
ver2:versionLabel=1.0
|
||||
ver2:versionDescription=Initial Version
|
||||
|
||||
end note
|
||||
end
|
||||
V->R: OK
|
||||
deactivate V
|
||||
R->C: 200 OK
|
||||
deactivate R
|
||||
|
||||
C->R:HTTP PUT (cm:name=bar.txt)
|
||||
activate R
|
||||
group "transaction"
|
||||
R->V
|
||||
V->SS: update node
|
||||
activate V
|
||||
activate SS
|
||||
SS->DB: update node
|
||||
activate DB
|
||||
DB->SS: OK
|
||||
deactivate DB
|
||||
SS->V: OK
|
||||
deactivate SS
|
||||
note right of SS
|
||||
workspace://SpacesStore/6060b6b6-2928-4092-ab66-659a7e68c0f6
|
||||
cm:autoVersionOnUpdateProps=true
|
||||
cm:name=bar.txt
|
||||
cm:versionLabel=1.1
|
||||
end note
|
||||
|
||||
V->VS: create a new child of the version history node
|
||||
activate VS
|
||||
VS->DB: create node
|
||||
activate DB
|
||||
DB->VS: OK
|
||||
deactivate DB
|
||||
VS->V: OK
|
||||
deactivate VS
|
||||
note right of VS
|
||||
One Version History Node with two children...
|
||||
|
||||
workspace://version2Store/62de48fa-6adc-4228-8667-df62584f98de
|
||||
cm:autoVersionOnUpdateProps=true
|
||||
cm:name=foo.txt
|
||||
cm:versionLabel=null
|
||||
ver2:versionLabel=1.0
|
||||
ver2:versionDescription=Initial Version
|
||||
|
||||
NEW CHILD:
|
||||
workspace://version2Store/64d5fd85-40d3-4a44-b644-d871cb3a1030
|
||||
cm:autoVersionOnUpdateProps=true
|
||||
cm:name=bar.txt
|
||||
cm:versionLabel=1.0
|
||||
ver2:versionLabel=1.1
|
||||
ver2:versionDescription=Update Name
|
||||
|
||||
end note
|
||||
|
||||
end
|
||||
@enduml
|
After Width: | Height: | Size: 124 KiB |
@@ -0,0 +1,144 @@
|
||||
@startuml
|
||||
|
||||
Title: Autoversion on Content Update - Versioning Flow
|
||||
|
||||
participant "CMIS Client" as C
|
||||
participant "Repository" as R
|
||||
participant "Version Service" as V
|
||||
participant "workspace://SpacesStore" as SS
|
||||
participant "workspace://version2Store" as VS
|
||||
participant "File System" as FS
|
||||
database "Database" as DB
|
||||
|
||||
C->R:HTTP POST
|
||||
activate R
|
||||
group "transaction"
|
||||
R->V
|
||||
activate V
|
||||
|
||||
V->SS: create node
|
||||
activate SS
|
||||
SS->DB: create node
|
||||
activate DB
|
||||
DB->SS: OK
|
||||
deactivate DB
|
||||
SS->V: OK
|
||||
deactivate SS
|
||||
note right of SS
|
||||
workspace://SpacesStore/e8cc2b68-7482-4304-a93e-02c758a80954
|
||||
cm:autoVersionOnUpdateProps=false
|
||||
cm:name=foo.txt
|
||||
cm:versionLabel=1.0
|
||||
end note
|
||||
V->VS: create version history node with one child node
|
||||
activate VS
|
||||
VS->DB: create nodes
|
||||
activate DB
|
||||
DB->VS: OK
|
||||
deactivate DB
|
||||
VS->V: OK
|
||||
deactivate VS
|
||||
note right of VS
|
||||
One Version History Node with one child ...
|
||||
|
||||
workspace://version2Store/ce68aba3-73f6-44f9-ad9b-a9e8d77212de
|
||||
cm:autoVersionOnUpdateProps=false
|
||||
cm:name=foo.txt
|
||||
cm:versionLabel=null
|
||||
ver2:versionLabel=1.0
|
||||
ver2:versionDescription=Initial Version
|
||||
|
||||
end note
|
||||
end
|
||||
V->R: OK
|
||||
deactivate V
|
||||
R->C: 200 OK
|
||||
deactivate R
|
||||
|
||||
C->R:HTTP PUT (cm:name=bar.txt)
|
||||
activate R
|
||||
group "transaction"
|
||||
R->V
|
||||
V->SS: update node
|
||||
activate V
|
||||
activate SS
|
||||
SS->DB: update node
|
||||
activate DB
|
||||
DB->SS: OK
|
||||
deactivate DB
|
||||
SS->V: OK
|
||||
deactivate SS
|
||||
note right of SS
|
||||
workspace://SpacesStore/e8cc2b68-7482-4304-a93e-02c758a80954
|
||||
cm:autoVersionOnUpdateProps=false
|
||||
cm:name=bar.txt
|
||||
cm:versionLabel=1.0
|
||||
end note
|
||||
|
||||
note right of VS
|
||||
One Version History Node with one child...
|
||||
|
||||
workspace://version2Store/ce68aba3-73f6-44f9-ad9b-a9e8d77212de
|
||||
cm:autoVersionOnUpdateProps=false
|
||||
cm:name=foo.txt
|
||||
cm:versionLabel=null
|
||||
ver2:versionLabel=1.0
|
||||
ver2:versionDescription=Initial Version
|
||||
|
||||
end note
|
||||
|
||||
end
|
||||
|
||||
C->R:HTTP PUT (new file content)
|
||||
activate R
|
||||
group "transaction"
|
||||
R->V
|
||||
activate V
|
||||
V->SS: update node
|
||||
activate SS
|
||||
SS->FS: write file content
|
||||
activate FS
|
||||
FS->SS: OK
|
||||
deactivate FS
|
||||
SS->DB: update node to point to new file content
|
||||
activate DB
|
||||
DB->SS: OK
|
||||
deactivate DB
|
||||
SS->V: OK
|
||||
deactivate SS
|
||||
note right of SS
|
||||
workspace://SpacesStore/e8cc2b68-7482-4304-a93e-02c758a80954
|
||||
cm:autoVersionOnUpdateProps=false
|
||||
cm:name=bar.txt
|
||||
cm:versionLabel=1.0
|
||||
end note
|
||||
V->VS: create a new child of the version history node
|
||||
activate VS
|
||||
VS->DB: create node
|
||||
activate DB
|
||||
DB->VS: OK
|
||||
deactivate DB
|
||||
VS->V: OK
|
||||
deactivate VS
|
||||
note right of VS
|
||||
One Version History Node with two children...
|
||||
|
||||
workspace://version2Store/ce68aba3-73f6-44f9-ad9b-a9e8d77212de
|
||||
cm:autoVersionOnUpdateProps=false
|
||||
cm:name=foo.txt
|
||||
cm:versionLabel=null
|
||||
ver2:versionLabel=1.0
|
||||
ver2:versionDescription=Initial Version
|
||||
|
||||
NEW CHILD:
|
||||
workspace://version2Store/9fb3fb08-7cfb-4c0a-ac72-233aaf60fa1e
|
||||
cm:autoVersionOnUpdateProps=false
|
||||
cm:name=bar.txt
|
||||
cm:versionLabel=1.0
|
||||
ver2:versionLabel=1.1
|
||||
ver2:versionDescription=Update New File Content
|
||||
|
||||
end note
|
||||
end
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 34 KiB |
@@ -0,0 +1,37 @@
|
||||
@startuml
|
||||
|
||||
title Actions: Asynchronous Actions Classes (V5.1 Current)
|
||||
|
||||
interface ActionService {
|
||||
+ void executeAction(Action action, NodeRef actionedUponNodeRef, boolean checkConditions, boolean executeAsychronously)
|
||||
}
|
||||
class ActionServiceImpl implements ActionService {
|
||||
- ActionTransactionListener transactionListener
|
||||
- Map<String, AsynchronousActionExecutionQueue> asynchronousActionExecutionQueues
|
||||
+ void registerAsynchronousActionExecutionQueue(String key, AsynchronousActionExecutionQueue asyncExecQueue)
|
||||
+ void executeAction(...)
|
||||
- void addPostTransactionPendingAction(action, actionedUponNodeRef, checkConditions, actionChain)
|
||||
- List<PendingAction> getPostTransactionPendingActions()
|
||||
+ postCommit()
|
||||
- queueAction(PendingAction action)
|
||||
+ etc(...)
|
||||
}
|
||||
|
||||
interface AsynchronousActionExecutionQueue {
|
||||
+ void executeAction(RuntimeActionService actionService, Action action, NodeRef actionedUponNodeRef, boolean checkConditions, Set<String> actionChain);
|
||||
}
|
||||
class AsynchronousActionExecutionQueueImpl implements AsynchronousActionExecutionQueue {
|
||||
- ThreadPoolExecutor threadPoolExecutor
|
||||
- TransactionService transactionService
|
||||
- PolicyComponent policyComponent
|
||||
- Map<String, AbstractAsynchronousActionFilter> actionFilters
|
||||
- String id
|
||||
+ void init()
|
||||
+ void executeAction(...)
|
||||
+ etc(...)
|
||||
}
|
||||
|
||||
AsynchronousActionExecutionQueueImpl o- "1" ActionServiceImpl
|
||||
AsynchronousActionExecutionQueueImpl "0..*" -o ActionServiceImpl
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 57 KiB |
@@ -0,0 +1,61 @@
|
||||
@startuml
|
||||
|
||||
title Actions: Queued Actions Classes (V5.2 Proposal)
|
||||
|
||||
interface ActionService {
|
||||
+ void executeAction(Action action, NodeRef actionedUponNodeRef, boolean checkConditions, boolean executeAsychronously)
|
||||
}
|
||||
class ActionServiceImpl implements ActionService {
|
||||
- ActionTransactionListener transactionListener
|
||||
- Map<String, AsynchronousActionExecutionQueue> asynchronousActionExecutionQueues
|
||||
+ void registerAsynchronousActionExecutionQueue(String key, AsynchronousActionExecutionQueue asyncExecQueue)
|
||||
+ void executeAction(...)
|
||||
- <b>void bindPendingActionToTransaction(action, actionedUponNodeRef, checkConditions, actionChain)</b>
|
||||
- <s>void addPostTransactionPendingAction(action, actionedUponNodeRef, checkConditions, actionChain)</s>
|
||||
- List<PendingAction> getPostTransactionPendingActions()
|
||||
+ <b>beforeCommit()</b>
|
||||
+ <s>postCommit()</s>
|
||||
- queueAction(PendingAction action)
|
||||
+ etc(...)
|
||||
}
|
||||
|
||||
interface AsynchronousActionExecutionQueue {
|
||||
+ void executeAction(RuntimeActionService actionService, Action action, NodeRef actionedUponNodeRef, boolean checkConditions, Set<String> actionChain);
|
||||
}
|
||||
class AsynchronousActionExecutionQueueImpl implements AsynchronousActionExecutionQueue {
|
||||
- <b>ProducerTemplate producerTemplate</b>
|
||||
- <s>ThreadPoolExecutor threadPoolExecutor</s>
|
||||
- TransactionService transactionService
|
||||
- PolicyComponent policyComponent
|
||||
- Map<String, AbstractAsynchronousActionFilter> actionFilters
|
||||
- String id
|
||||
+ void init()
|
||||
+ void executeAction(...)
|
||||
+ etc(...)
|
||||
}
|
||||
|
||||
package org::apache::camel {
|
||||
class ProducerTemplate {
|
||||
+ void sendBodyAndHeaders(String endpointUri, Object body, Map<String, Object> headers)
|
||||
}
|
||||
class RouteBuilder {
|
||||
+ void configure()
|
||||
+ etc(...)
|
||||
}
|
||||
class JacksonDataFormat
|
||||
}
|
||||
|
||||
class QueuedActionProducer extends RouteBuilder {
|
||||
+ void configure()
|
||||
}
|
||||
class QueuedActionReceiver extends RouteBuilder {
|
||||
+ void configure()
|
||||
}
|
||||
|
||||
AsynchronousActionExecutionQueueImpl o- "1" ActionServiceImpl
|
||||
AsynchronousActionExecutionQueueImpl "0..*" -o ActionServiceImpl
|
||||
AsynchronousActionExecutionQueueImpl o- "1" ProducerTemplate
|
||||
QueuedActionProducer --> "uses" JacksonDataFormat
|
||||
QueuedActionReceiver --> "uses" JacksonDataFormat
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 38 KiB |
@@ -0,0 +1,63 @@
|
||||
@startuml
|
||||
class RuleType {
|
||||
String name
|
||||
String displayLabel
|
||||
}
|
||||
|
||||
class Rule {
|
||||
NodeRef nodeRef
|
||||
String title
|
||||
String description
|
||||
boolean ruleDisabled
|
||||
boolean executeAsynchronously
|
||||
boolean isAppliedToChildren
|
||||
}
|
||||
|
||||
class Action
|
||||
|
||||
class RuleTrigger
|
||||
|
||||
|
||||
Rule --> "1..*" RuleType
|
||||
Rule --> "1" Action
|
||||
|
||||
RuleType --> "*" RuleTrigger
|
||||
|
||||
note left of RuleType
|
||||
There are three rule types defined by default:
|
||||
- inbound
|
||||
- outbound
|
||||
- update
|
||||
end note
|
||||
|
||||
together {
|
||||
class BeforeDeleteChildAssociationRuleTrigger
|
||||
class CreateNodeRuleTrigger
|
||||
class OnCreateChildAssociationRuleTrigger
|
||||
class OnMoveNodeRuleTrigger
|
||||
class OnPropertyUpdateRuleTrigger
|
||||
class RestoreNodeRuleTrigger
|
||||
class SingleAssocRefPolicyRuleTrigger
|
||||
class SingleNodeRefPolicyRuleTrigger
|
||||
}
|
||||
|
||||
CreateNodeRuleTrigger -[hidden]--> BeforeDeleteChildAssociationRuleTrigger
|
||||
OnMoveNodeRuleTrigger -[hidden]--> OnCreateChildAssociationRuleTrigger
|
||||
OnPropertyUpdateRuleTrigger -[hidden]--> RestoreNodeRuleTrigger
|
||||
SingleAssocRefPolicyRuleTrigger -[hidden]--> SingleNodeRefPolicyRuleTrigger
|
||||
|
||||
RuleTrigger <|-- BeforeDeleteChildAssociationRuleTrigger
|
||||
RuleTrigger <|-- CreateNodeRuleTrigger
|
||||
RuleTrigger <|-- OnCreateChildAssociationRuleTrigger
|
||||
RuleTrigger <|-- OnMoveNodeRuleTrigger
|
||||
RuleTrigger <|-- OnPropertyUpdateRuleTrigger
|
||||
RuleTrigger <|-- RestoreNodeRuleTrigger
|
||||
RuleTrigger <|-- SingleAssocRefPolicyRuleTrigger
|
||||
RuleTrigger <|-- SingleNodeRefPolicyRuleTrigger
|
||||
|
||||
|
||||
note right of Action
|
||||
See separate diagram for info about Actions
|
||||
end note
|
||||
|
||||
@enduml
|
After Width: | Height: | Size: 18 KiB |
@@ -0,0 +1,26 @@
|
||||
@startuml
|
||||
left to right direction
|
||||
skinparam linetype ortho
|
||||
|
||||
component Client
|
||||
component TransformationEngine {
|
||||
component Service
|
||||
component Router
|
||||
component Configuration
|
||||
}
|
||||
component AdminConsole
|
||||
component Log
|
||||
component TransformationFarm {
|
||||
component Worker1
|
||||
component Worker2
|
||||
component Worker3
|
||||
}
|
||||
Client->Service:calls
|
||||
Service->Router:calls
|
||||
Router->Configuration:reads
|
||||
AdminConsole->Configuration:sets
|
||||
Service->Log:writes
|
||||
AdminConsole->Log:writes
|
||||
Router->Worker1:calls
|
||||
|
||||
@enduml
|
7
repository/l10n.properties
Normal file
@@ -0,0 +1,7 @@
|
||||
# Branch specific configuration file for localisation scripts
|
||||
|
||||
MESSAGE_SEARCH_PATH="src/main/resources/alfresco/messages/action-config*.properties src/main/resources/alfresco/messages/action-service*.properties src/main/resources/alfresco/messages/activiti-engine-messages*.properties src/main/resources/alfresco/messages/activities-service*.properties src/main/resources/alfresco/messages/activity-list*.properties src/main/resources/alfresco/messages/application-model*.properties src/main/resources/alfresco/messages/authentication*.properties src/main/resources/alfresco/messages/bootstrap-content-template-examples*.properties src/main/resources/alfresco/messages/bootstrap-example-javascripts*.properties src/main/resources/alfresco/messages/bootstrap-example-smartfoldertemplates*.properties src/main/resources/alfresco/messages/bootstrap-imapScripts*.properties src/main/resources/alfresco/messages/bootstrap-javascripts*.properties src/main/resources/alfresco/messages/bootstrap-messages*.properties src/main/resources/alfresco/messages/bootstrap-readme-template*.properties src/main/resources/alfresco/messages/bootstrap-spaces*.properties src/main/resources/alfresco/messages/bootstrap-templates*.properties src/main/resources/alfresco/messages/bootstrap-tutorial*.properties src/main/resources/alfresco/messages/bootstrap-webScripts*.properties src/main/resources/alfresco/messages/bootstrap-webScriptsExtensions*.properties src/main/resources/alfresco/messages/bpm-messages*.properties src/main/resources/alfresco/messages/categories*.properties src/main/resources/alfresco/messages/coci-service*.properties src/main/resources/alfresco/messages/content-filter-languages*.properties src/main/resources/alfresco/messages/content-model*.properties src/main/resources/alfresco/messages/copy-service*.properties src/main/resources/alfresco/messages/custommodel-service*.properties src/main/resources/alfresco/messages/discussion-messages*.properties src/main/resources/alfresco/messages/distributionpolicies-model*.properties src/main/resources/alfresco/messages/doclink-service*.properties src/main/resources/alfresco/messages/download-model*.properties src/main/resources/alfresco/messages/email-server-model*.properties src/main/resources/alfresco/messages/email-service*.properties src/main/resources/alfresco/messages/file-folder-service*.properties src/main/resources/alfresco/messages/form-service*.properties src/main/resources/alfresco/messages/forum-model*.properties src/main/resources/alfresco/messages/imap-service*.properties src/main/resources/alfresco/messages/initiate-inplace*.properties src/main/resources/alfresco/messages/invitation-service*.properties src/main/resources/alfresco/messages/lock-service*.properties src/main/resources/alfresco/messages/notification-service*.properties src/main/resources/alfresco/messages/period-provider*.properties src/main/resources/alfresco/messages/permissions-service*.properties src/main/resources/alfresco/messages/quickshare-service*.properties src/main/resources/alfresco/messages/rendition-config*.properties src/main/resources/alfresco/messages/replication*.properties src/main/resources/alfresco/messages/repoadmin-service*.properties src/main/resources/alfresco/messages/reset-password-messages*.properties src/main/resources/alfresco/messages/rule-config*.properties src/main/resources/alfresco/messages/site-model*.properties src/main/resources/alfresco/messages/site-service*.properties src/main/resources/alfresco/messages/slingshot*.properties src/main/resources/alfresco/messages/smartfolder-model*.properties src/main/resources/alfresco/messages/subscription-service*.properties src/main/resources/alfresco/messages/system-messages*.properties src/main/resources/alfresco/messages/system-model*.properties src/main/resources/alfresco/messages/template-service*.properties src/main/resources/alfresco/messages/templates-messages*.properties src/main/resources/alfresco/messages/transfer-model*.properties src/main/resources/alfresco/messages/transfer-service*.properties src/main/resources/alfresco/messages/ui-inplace*.properties src/main/resources/alfresco/messages/webdav-messages*.properties src/main/resources/alfresco/messages/workflow-package-messages*.properties src/main/resources/alfresco/workflow/invitation-moderated-workflow-messages*.properties src/main/resources/alfresco/workflow/invitation-nominated-workflow-messages*.properties src/main/resources/alfresco/workflow/workflow-messages*.properties"
|
||||
|
||||
|
||||
EXCLUDED_FILES="src/main/resources/alfresco/messages/content-service.properties src/main/resources/alfresco/messages/module-messages.properties src/main/resources/alfresco/messages/patch-service.properties src/main/resources/alfresco/messages/repoadmin-interpreter-help.properties src/main/resources/alfresco/messages/schema-update.properties src/main/resources/alfresco/messages/tenant-interpreter-help.properties src/main/resources/alfresco/messages/version-service.properties src/main/resources/alfresco/messages/workflow-interpreter-help.properties src/main/resources/alfresco/alfresco-shared.properties src/main/resources/alfresco/caches.properties src/main/resources/alfresco/repository.properties src/main/resources/alfresco/client/config/repo-clients-apps.properties src/main/resources/alfresco/domain/cache-strategies.properties src/main/resources/alfresco/domain/hibernate-cfg.properties src/main/resources/alfresco/domain/quartz.properties src/main/resources/alfresco/domain/transaction.properties src/main/resources/alfresco/keystore/keystore-passwords.properties src/main/resources/alfresco/keystore/ssl-keystore-passwords.properties src/main/resources/alfresco/keystore/ssl-truststore-passwords.properties src/main/resources/alfresco/metadata/DWGMetadataExtracter.properties src/main/resources/alfresco/metadata/HtmlMetadataExtracter.properties src/main/resources/alfresco/metadata/MailMetadataExtracter.properties src/main/resources/alfresco/metadata/MP3MetadataExtracter.properties src/main/resources/alfresco/metadata/OfficeMetadataExtracter.properties src/main/resources/alfresco/metadata/PdfBoxMetadataExtracter.properties src/main/resources/alfresco/metadata/PoiMetadataExtracter.properties src/main/resources/alfresco/metadata/RFC822MetadataExtracter.properties src/main/resources/alfresco/metadata/TikaAudioMetadataExtracter.properties src/main/resources/alfresco/metadata/TikaAutoMetadataExtracter.properties src/main/resources/alfresco/metadata/TikaSpringConfiguredMetadataExtracter.properties src/main/resources/alfresco/subsystems/ActivitiesFeed/default/activities-jobs.properties src/main/resources/alfresco/subsystems/Authentication/alfrescoNtlm/alfresco-authentication.properties src/main/resources/alfresco/subsystems/Authentication/external/external-authentication.properties src/main/resources/alfresco/subsystems/Authentication/kerberos/kerberos-authentication.properties src/main/resources/alfresco/subsystems/Authentication/ldap/ldap-authentication.properties src/main/resources/alfresco/subsystems/Authentication/ldap-ad/ldap-ad-authentication.properties src/main/resources/alfresco/subsystems/Authentication/passthru/passthru-authentication-context.properties src/main/resources/alfresco/subsystems/email/InboundSMTP/inboundSMTP.properties src/main/resources/alfresco/subsystems/email/OutboundSMTP/outboundSMTP.properties src/main/resources/alfresco/subsystems/fileServers/default/file-servers.properties src/main/resources/alfresco/subsystems/imap/default/imap-server.properties src/main/resources/alfresco/subsystems/Replication/default/replication.properties src/main/resources/alfresco/subsystems/Search/noindex/common-search.properties src/main/resources/alfresco/subsystems/Search/noindex/noindex-search.properties src/main/resources/alfresco/subsystems/Search/solr/common-search.properties src/main/resources/alfresco/subsystems/Search/solr/solr-backup.properties src/main/resources/alfresco/subsystems/Search/solr/solr-search.properties src/main/resources/alfresco/subsystems/Search/solr/facet/solr-facets-config.properties src/main/resources/alfresco/subsystems/Search/solr4/common-search.properties src/main/resources/alfresco/subsystems/Search/solr4/solr-backup.properties src/main/resources/alfresco/subsystems/Search/solr4/solr-search.properties src/main/resources/alfresco/subsystems/Search/solr6/common-search.properties src/main/resources/alfresco/subsystems/Search/solr6/solr-backup.properties src/main/resources/alfresco/subsystems/Search/solr6/solr-search.properties src/main/resources/alfresco/subsystems/Subscriptions/default/subscription-service.properties src/main/resources/alfresco/subsystems/Synchronization/default/default-synchronization.properties src/main/resources/alfresco/subsystems/sysAdmin/default/sysadmin-parameter.properties src/main/resources/alfresco/subsystems/thirdparty/default/alfresco-pdf-renderer-transform.properties src/main/resources/alfresco/subsystems/thirdparty/default/imagemagick-transform.properties src/main/resources/alfresco/subsystems/Transformers/default/transformers.properties src/main/resources/org/alfresco/encryption/keystore-parameters.properties src/main/resources/org/alfresco/repo/i18n/testMessages.properties src/main/resources/org/alfresco/repo/module/tool/default-file-mapping.properties src/main/resources/alfresco/metadata/JodConverterMetadataExtracter.properties src/main/resources/alfresco/subsystems/OOoJodconverter/default/jodconverter.properties"
|
||||
|
1235
repository/pom.xml
Normal file
2
repository/src/main/META-INF/bm-remote-manifest.mf
Normal file
@@ -0,0 +1,2 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: org.alfresco.repo.model.filefolder.loader.FileFolderRemoteLoader
|
2
repository/src/main/META-INF/mmt-manifest.mf
Normal file
@@ -0,0 +1,2 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: org.alfresco.repo.module.tool.ModuleManagementTool
|
BIN
repository/src/main/cpp/CAlfrescoApp/CAlfrescoApp.aps
Normal file
874
repository/src/main/cpp/CAlfrescoApp/CAlfrescoApp.cpp
Normal file
@@ -0,0 +1,874 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2006 Alfresco, Inc.
|
||||
*
|
||||
* Licensed under the Mozilla Public License version 1.1
|
||||
* with a permitted attribution clause. You may obtain a
|
||||
* copy of the License at
|
||||
*
|
||||
* http://www.alfresco.org/legal/license.txt
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
|
||||
* either express or implied. See the License for the specific
|
||||
* language governing permissions and limitations under the
|
||||
* License.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "CAlfrescoApp.h"
|
||||
#include "CAlfrescoAppDlg.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "util\String.h"
|
||||
#include "util\DataBuffer.h"
|
||||
#include "util\FileName.h"
|
||||
#include "util\Integer.h"
|
||||
#include "util\Debug.h"
|
||||
|
||||
#include <shellapi.h>
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
using namespace Alfresco;
|
||||
|
||||
// CCAlfrescoAppApp
|
||||
|
||||
BEGIN_MESSAGE_MAP(CAlfrescoApp, CWinApp)
|
||||
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
// CCAlfrescoApp construction
|
||||
|
||||
CAlfrescoApp::CAlfrescoApp()
|
||||
{
|
||||
// TODO: add construction code here,
|
||||
// Place all significant initialization in InitInstance
|
||||
}
|
||||
|
||||
|
||||
// The one and only CCAlfrescoAppApp object
|
||||
|
||||
CAlfrescoApp theApp;
|
||||
|
||||
|
||||
// CCAlfrescoAppApp initialization
|
||||
|
||||
BOOL CAlfrescoApp::InitInstance()
|
||||
{
|
||||
// InitCommonControls() is required on Windows XP if an application
|
||||
// manifest specifies use of ComCtl32.dll version 6 or later to enable
|
||||
// visual styles. Otherwise, any window creation will fail.
|
||||
|
||||
InitCommonControls();
|
||||
CWinApp::InitInstance();
|
||||
AfxEnableControlContainer();
|
||||
|
||||
// Check if debug logging is enabled
|
||||
|
||||
char dbgLogName[MAX_PATH];
|
||||
size_t dbgLogSize;
|
||||
|
||||
if ( getenv_s( &dbgLogSize, dbgLogName, sizeof( dbgLogName), "ALFDEBUG") == 0) {
|
||||
|
||||
// Enable debug output
|
||||
|
||||
Debug::openLog( dbgLogName);
|
||||
|
||||
// Log the application startup
|
||||
|
||||
DBGOUT_TS << "---------- Desktop client app started ----------" << endl;
|
||||
}
|
||||
|
||||
// Get the application path
|
||||
|
||||
String appPath = __wargv[0];
|
||||
|
||||
int pos = appPath.lastIndexOf(PathSeperator);
|
||||
|
||||
if ( pos < 0) {
|
||||
AfxMessageBox( L"Invalid application path", MB_OK | MB_ICONSTOP);
|
||||
DBGOUT_TS << "Error, bad application path, " << appPath << endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Get the path to the folder containing the application
|
||||
|
||||
String folderPath = appPath.substring(0, pos);
|
||||
String exeName = appPath.substring(pos + 1);
|
||||
|
||||
// Create a list of the command line arguments
|
||||
|
||||
StringList argList;
|
||||
bool argSetWorkDir = false;
|
||||
|
||||
for ( int i = 1; i < __argc; i++) {
|
||||
|
||||
// Check if the argument is a path or switch
|
||||
|
||||
String arg = __wargv[i];
|
||||
|
||||
if ( arg.startsWith( "/")) {
|
||||
|
||||
// Check for the set working directory switch
|
||||
|
||||
if ( arg.equalsIgnoreCase( "/D")) {
|
||||
argSetWorkDir = true;
|
||||
|
||||
// DEBUG
|
||||
|
||||
DBGOUT_TS << "/D switch specified" << endl;
|
||||
}
|
||||
else {
|
||||
String msg = L"Invalid command line switch - ";
|
||||
msg.append( arg);
|
||||
AfxMessageBox( msg.data(), MB_OK | MB_ICONSTOP);
|
||||
DBGOUT_TS << "Error, " << msg << endl;
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
// Add the path to the argument list
|
||||
|
||||
argList.addString( arg);
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the working directory should be set to the path of the first document
|
||||
|
||||
if ( argSetWorkDir == true) {
|
||||
|
||||
// Check if there are any document paths
|
||||
|
||||
if ( argList.numberOfStrings() == 0) {
|
||||
AfxMessageBox( L"Cannot set working directory, no document paths", MB_OK | MB_ICONSTOP);
|
||||
DBGOUT_TS << "Error, cannot set working directory, no document paths" << endl;
|
||||
return 3;
|
||||
}
|
||||
|
||||
// Get the first document path and remove the file name
|
||||
|
||||
String docPath = argList[0];
|
||||
pos = docPath.lastIndexOf( PathSeperator);
|
||||
|
||||
if ( pos < 0) {
|
||||
AfxMessageBox( L"Invalid document path", MB_OK | MB_ICONSTOP);
|
||||
DBGOUT_TS << "Error, invalid document path, " << docPath << endl;
|
||||
return 4;
|
||||
}
|
||||
|
||||
// Set the document path as the working directory folder
|
||||
|
||||
folderPath = docPath.substring(0, pos);
|
||||
|
||||
// DEBUG
|
||||
|
||||
DBGOUT_TS << "Using document path as working directory, " << folderPath << endl;
|
||||
}
|
||||
|
||||
// DEBUG
|
||||
|
||||
if ( HAS_DEBUG)
|
||||
DBGOUT_TS << "Using folder path " << folderPath << " for Alfresco base dir" << endl;
|
||||
|
||||
// Create the Alfresco interface
|
||||
|
||||
AlfrescoInterface alfresco(folderPath);
|
||||
|
||||
if ( alfresco.isAlfrescoFolder()) {
|
||||
|
||||
try {
|
||||
|
||||
// DEBUG
|
||||
|
||||
DBGOUT_TS << "Using folder " << folderPath << endl;
|
||||
|
||||
// Get the action information
|
||||
|
||||
AlfrescoActionInfo actionInfo = alfresco.getActionInformation(exeName);
|
||||
|
||||
// DEBUG
|
||||
|
||||
if ( HAS_DEBUG) {
|
||||
DBGOUT_TS << "Action " << actionInfo.getName() << endl;
|
||||
DBGOUT_TS << " PreProcess: ";
|
||||
|
||||
if ( actionInfo.hasPreProcessAction( PreConfirmAction))
|
||||
DBGOUT << "Confirm ";
|
||||
if ( actionInfo.hasPreProcessAction( PreCopyToTarget))
|
||||
DBGOUT << "CopyToTarget ";
|
||||
if ( actionInfo.hasPreProcessAction( PreLocalToWorkingCopy))
|
||||
DBGOUT << "LocalToWorkingCopy";
|
||||
DBGOUT << endl;
|
||||
}
|
||||
|
||||
// Check if the action should be confirmed
|
||||
|
||||
if ( actionInfo.hasPreProcessAction(PreConfirmAction)) {
|
||||
|
||||
// Get the confirmation message
|
||||
|
||||
String confirmMsg = actionInfo.getConfirmationMessage();
|
||||
if ( confirmMsg.length() == 0)
|
||||
confirmMsg = L"Run action ?";
|
||||
|
||||
// DEBUG
|
||||
|
||||
DBGOUT_TS << "Confirm action, message = " << confirmMsg << endl;
|
||||
|
||||
// Display a confirmation dialog
|
||||
|
||||
if ( AfxMessageBox( confirmMsg, MB_OKCANCEL | MB_ICONQUESTION) == IDCANCEL) {
|
||||
DBGOUT_TS << "User cancelled action" << endl;
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if the action supports multiple paths, if not then call the action once for each supplied path
|
||||
|
||||
if ( actionInfo.hasAttribute(AttrMultiplePaths)) {
|
||||
|
||||
// Run the action
|
||||
|
||||
runAction( alfresco, argList, actionInfo);
|
||||
}
|
||||
|
||||
// Check if the action supports file/folder targets
|
||||
|
||||
else if ( actionInfo.hasAttribute( AttrAnyFilesFolders) == true) {
|
||||
|
||||
// Pass one path at a time to the action
|
||||
|
||||
for ( size_t i = 0; i < argList.numberOfStrings(); i++) {
|
||||
|
||||
// Create a path list with a single path
|
||||
|
||||
StringList pathList;
|
||||
pathList.addString( argList[i]);
|
||||
|
||||
// Run the action
|
||||
|
||||
runAction( alfresco, pathList, actionInfo);
|
||||
}
|
||||
}
|
||||
|
||||
// Action does not use targets, just run the action
|
||||
|
||||
else if ( actionInfo.allowsNoParameters()) {
|
||||
|
||||
// Run the action
|
||||
|
||||
StringList emptyList;
|
||||
runAction( alfresco, emptyList, actionInfo);
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
CString msg;
|
||||
msg.FormatMessage( L"Exception occurred\n\n%1", ex.getMessage().data());
|
||||
AfxMessageBox( msg, MB_OK | MB_ICONSTOP);
|
||||
}
|
||||
}
|
||||
else {
|
||||
AfxMessageBox( L"Not a valid Alfresco CIFS folder", MB_OK | MB_ICONSTOP);
|
||||
DBGOUT_TS << "Error, not a valid Alfresco CIFS folder, " << folderPath << endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Exit the application
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Process the command line arguments and build the parameter list for the desktop action
|
||||
*
|
||||
* @param alfresco AlfrescoInterface&
|
||||
* @param paths StringList&
|
||||
* @param actionInfo AlfrescoActionInfo&
|
||||
* @param params DesktopParams&
|
||||
* @return bool
|
||||
*/
|
||||
bool CAlfrescoApp::buildDesktopParameters( AlfrescoInterface& alfresco, StringList& paths, AlfrescoActionInfo& actionInfo,
|
||||
DesktopParams& params) {
|
||||
|
||||
// If there are no paths then just return a success
|
||||
|
||||
if ( paths.numberOfStrings() == 0)
|
||||
return true;
|
||||
|
||||
// Process the list of files and either check in the file if it is a working copy or check out
|
||||
// the file
|
||||
|
||||
for ( unsigned int i = 0; i < paths.numberOfStrings(); i++) {
|
||||
|
||||
// Get the current file name
|
||||
|
||||
String curFile = paths.getStringAt( i);
|
||||
|
||||
// DEBUG
|
||||
|
||||
DBGOUT_TS << "Parameter: " << curFile << endl;
|
||||
|
||||
// Check if the path is on an Alfresco mapped drive
|
||||
|
||||
if ( alfresco.isMappedDrive() && curFile.startsWithIgnoreCase( alfresco.getDrivePath())) {
|
||||
|
||||
// Convert the path to a UNC path
|
||||
|
||||
String uncPath = alfresco.getRootPath();
|
||||
uncPath.append( curFile.substring(3));
|
||||
|
||||
curFile = uncPath;
|
||||
}
|
||||
|
||||
// Check if the path is to a file/folder, and whether it is a local path
|
||||
|
||||
bool copyFile = false;
|
||||
DWORD attr = GetFileAttributes( curFile);
|
||||
|
||||
if ( attr != INVALID_FILE_ATTRIBUTES) {
|
||||
|
||||
// Check if the action supports the file/folder type
|
||||
|
||||
bool isDir = (attr & FILE_ATTRIBUTE_DIRECTORY) != 0 ? true : false;
|
||||
|
||||
if ( isDir && actionInfo.supportsFolders() == false) {
|
||||
AfxMessageBox(L"Action does not support folders", MB_OK | MB_ICONSTOP);
|
||||
DBGOUT_TS << "Error, action does not support folders" << endl;
|
||||
return false;
|
||||
}
|
||||
else if ( actionInfo.supportsFiles() == false) {
|
||||
AfxMessageBox(L"Action does not support files", MB_OK | MB_ICONSTOP);
|
||||
DBGOUT_TS << "Error, action does not support files" << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the file name from the path
|
||||
|
||||
StringList nameParts = FileName::splitPath( curFile);
|
||||
String curName = nameParts.getStringAt( 1);
|
||||
|
||||
// If the path is to a file that is not on the Alfresco share the file will need to be copied,
|
||||
// after checking the status of a matching file in the Alfresco folder
|
||||
|
||||
if ( curFile.length() >= 3 && curFile.substring(1,3).equals( L":\\") &&
|
||||
(alfresco.isMappedDrive() == false || curFile.startsWithIgnoreCase( alfresco.getDrivePath()) == false)) {
|
||||
|
||||
// Check if the action supports local files
|
||||
|
||||
if ( isDir == false && actionInfo.hasAttribute(AttrClientFiles) == false) {
|
||||
AfxMessageBox(L"Action does not support local files", MB_OK | MB_ICONSTOP);
|
||||
DBGOUT_TS << "Error, action does not support local files" << endl;
|
||||
return false;
|
||||
}
|
||||
else if ( isDir == true && actionInfo.hasAttribute(AttrClientFolders) == false) {
|
||||
AfxMessageBox(L"Action does not support local folders", MB_OK | MB_ICONSTOP);
|
||||
DBGOUT_TS << "Error, action does not support local folders" << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if there is an existing file in the Alfresco with the same name, check if the file is locked
|
||||
|
||||
PTR_AlfrescoFileInfo fInfo = alfresco.getFileInformation( curName);
|
||||
if ( fInfo.get() != NULL) {
|
||||
|
||||
// There is an existing file in the Alfresco folder with the same name, check if it is locked
|
||||
|
||||
if ( fInfo->getLockType() != LockNone) {
|
||||
AfxMessageBox( L"Cannot copy file to Alfresco folder, destination file is locked", MB_OK | MB_ICONEXCLAMATION);
|
||||
DBGOUT_TS << "Error, cannot copy to Alfresco folder, destination file is locked" << endl;
|
||||
return false;
|
||||
}
|
||||
else if ( actionInfo.hasPreProcessAction(PreLocalToWorkingCopy) == true && fInfo->isWorkingCopy() == false) {
|
||||
AfxMessageBox( L"Cannot copy to Alfresco folder, destination must overwrite a working copy", MB_OK | MB_ICONEXCLAMATION);
|
||||
DBGOUT_TS << "Error, cannot copy to Alfresco folder, destination must overwrite a working copy" << endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if ( actionInfo.hasPreProcessAction(PreLocalToWorkingCopy) == true) {
|
||||
|
||||
// Target folder does not contain a matching working copy of the local file
|
||||
|
||||
CString msg;
|
||||
msg.FormatMessage( L"No matching working copy for %1", curName.data());
|
||||
AfxMessageBox( msg, MB_OK | MB_ICONEXCLAMATION);
|
||||
DBGOUT_TS << "Error, no matching working copy for " << curName << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Copy the files/folders using the Windows shell
|
||||
|
||||
bool copyAborted = false;
|
||||
|
||||
if ( copyFilesUsingShell( curFile, alfresco.getUNCPath(), copyAborted) == false) {
|
||||
|
||||
// Check if the copy failed or the user aborted the copy
|
||||
|
||||
if ( copyAborted == false) {
|
||||
|
||||
// File copy failed
|
||||
|
||||
CString msg;
|
||||
msg.FormatMessage( isDir ? L"Failed to copy folder %1" : L"Failed to copy file %1", curFile.data());
|
||||
|
||||
AfxMessageBox( msg, MB_OK | MB_ICONSTOP);
|
||||
DBGOUT_TS << "Error, copy failed for " << curName << endl;
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
|
||||
// User aborted the file copy
|
||||
|
||||
CString msg;
|
||||
msg.FormatMessage( L"Copy aborted for %1", curFile.data());
|
||||
AfxMessageBox( msg, MB_OK | MB_ICONSTOP);
|
||||
DBGOUT_TS << "Error, copy aborted by user, " << curName << endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// DEBUG
|
||||
|
||||
DBGOUT_TS << "Added target " << curName << endl;
|
||||
|
||||
// Add a desktop target for the copied file
|
||||
|
||||
params.addTarget( new DesktopTarget(isDir ? TargetCopiedFolder : TargetCopiedFile, curName));
|
||||
}
|
||||
else {
|
||||
|
||||
// Path is a UNC path, check if the file/folder is in the same folder as the action
|
||||
|
||||
DesktopTarget* pTarget = NULL;
|
||||
|
||||
if ( curFile.startsWith( alfresco.getUNCPath())) {
|
||||
|
||||
// Path is in the same folder as the application, or in a sub-folder
|
||||
|
||||
String relPath = curFile.substring( alfresco.getUNCPath().length() + 1);
|
||||
|
||||
if ( relPath.indexOf( L"\\") == -1) {
|
||||
|
||||
// Create a target using the file name only
|
||||
|
||||
pTarget = new DesktopTarget( isDir ? TargetFolder : TargetFile, relPath);
|
||||
}
|
||||
}
|
||||
|
||||
// If the target is not valid the file/folder is not in the same folder as the client-side application,
|
||||
// copy the files/folders to the target folder or use the root relative path to the file/folder
|
||||
|
||||
if ( pTarget == NULL) {
|
||||
|
||||
// Check if Alfresco files/folders should be copied to the target folder
|
||||
|
||||
if ( actionInfo.hasPreProcessAction(PreCopyToTarget)) {
|
||||
|
||||
// Copy the files/folders using the Windows shell
|
||||
|
||||
bool copyAborted = false;
|
||||
|
||||
if ( copyFilesUsingShell( curFile, alfresco.getUNCPath(), copyAborted) == false) {
|
||||
|
||||
// Check if the copy failed or the user aborted the copy
|
||||
|
||||
if ( copyAborted == false) {
|
||||
|
||||
// File copy failed
|
||||
|
||||
CString msg;
|
||||
msg.FormatMessage( isDir ? L"Failed to copy folder %1" : L"Failed to copy file %1", curFile.data());
|
||||
|
||||
AfxMessageBox( msg, MB_OK | MB_ICONSTOP);
|
||||
DBGOUT_TS << "Error, copy failed for " << curName << endl;
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
|
||||
// User aborted the file copy
|
||||
|
||||
CString msg;
|
||||
msg.FormatMessage( L"Copy aborted for %1", curFile.data());
|
||||
AfxMessageBox( msg, MB_OK | MB_ICONSTOP);
|
||||
DBGOUT_TS << "Error, copy aborted for " << curName << endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Add a desktop target for the copied file
|
||||
|
||||
pTarget= new DesktopTarget(isDir ? TargetCopiedFolder : TargetCopiedFile, curName);
|
||||
}
|
||||
else {
|
||||
|
||||
// Get the root relative path to the file/folder
|
||||
|
||||
String rootRelPath = curFile.substring(alfresco.getRootPath().length());
|
||||
pTarget = new DesktopTarget( isDir ? TargetFolder : TargetFile, rootRelPath);
|
||||
}
|
||||
}
|
||||
|
||||
// DEBUG
|
||||
|
||||
DBGOUT_TS << "Added target " << pTarget->getTarget() << endl;
|
||||
|
||||
// Add the desktop target
|
||||
|
||||
params.addTarget( pTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Return status
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy a file/folder using the Windows shell
|
||||
*
|
||||
* @param fromFileFolder const String&
|
||||
* @param toFolder const String&
|
||||
* @param aborted bool&
|
||||
* @return bool
|
||||
*/
|
||||
bool CAlfrescoApp::copyFilesUsingShell(const String& fromFileFolder, const String& toFolder, bool& aborted) {
|
||||
|
||||
// DEBUG
|
||||
|
||||
DBGOUT_TS << "Copy from " << fromFileFolder << " to " << toFolder << endl;
|
||||
|
||||
// Build the from/to paths, must be double null terminated
|
||||
|
||||
wchar_t fromPath[MAX_PATH + 1];
|
||||
wchar_t toPath[MAX_PATH + 1];
|
||||
|
||||
memset( fromPath, 0, sizeof( fromPath));
|
||||
memset( toPath, 0, sizeof( toPath));
|
||||
|
||||
wcscpy( fromPath, fromFileFolder.data());
|
||||
wcscpy( toPath, toFolder.data());
|
||||
|
||||
// Copy the local file to the Alfresco folder
|
||||
|
||||
SHFILEOPSTRUCT fileOpStruct;
|
||||
memset( &fileOpStruct, 0, sizeof(SHFILEOPSTRUCT));
|
||||
|
||||
fileOpStruct.hwnd = HWND_DESKTOP;
|
||||
fileOpStruct.wFunc = FO_COPY;
|
||||
fileOpStruct.pFrom = fromPath;
|
||||
fileOpStruct.pTo = toPath;
|
||||
fileOpStruct.fFlags= 0;
|
||||
fileOpStruct.fAnyOperationsAborted =false;
|
||||
|
||||
// Copy the file to the Alfresco folder
|
||||
|
||||
bool sts = false;
|
||||
|
||||
if ( SHFileOperation( &fileOpStruct) == 0) {
|
||||
|
||||
// File copy successful
|
||||
|
||||
sts = true;
|
||||
}
|
||||
else if ( fileOpStruct.fAnyOperationsAborted) {
|
||||
|
||||
// User aborted the file copy
|
||||
|
||||
aborted = true;
|
||||
}
|
||||
|
||||
// Return the copy status
|
||||
|
||||
return sts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Run an action
|
||||
*
|
||||
* @param alfresco AlfrescoInterface&
|
||||
* @param pathList StringList&
|
||||
* @param actionInfo AlfrescoActionInfo&
|
||||
* @return bool
|
||||
*/
|
||||
bool CAlfrescoApp::runAction( AlfrescoInterface& alfresco, StringList& pathList, AlfrescoActionInfo& actionInfo) {
|
||||
|
||||
// Build the desktop action parameter list, perform any file copying of local files
|
||||
|
||||
bool sts = false;
|
||||
DesktopParams desktopParams;
|
||||
|
||||
if ( buildDesktopParameters( alfresco, pathList, actionInfo, desktopParams)) {
|
||||
|
||||
// Check if the action requires parameters
|
||||
|
||||
if ( actionInfo.allowsNoParameters() == false && desktopParams.numberOfTargets() == 0) {
|
||||
AfxMessageBox( L"No parameters for action", MB_OK | MB_ICONEXCLAMATION);
|
||||
DBGOUT_TS << "Error, no parameters for action" << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Run the desktop action
|
||||
|
||||
DesktopResponse response = alfresco.runAction( actionInfo, desktopParams);
|
||||
|
||||
// Check the response status
|
||||
|
||||
if ( response.getStatus() != StsSuccess) {
|
||||
|
||||
// Check if the status indicates a command line should be launched
|
||||
|
||||
if ( response.getStatus() == StsCommandLine) {
|
||||
|
||||
// DEBUG
|
||||
|
||||
DBGOUT_TS << "Action returned command line, " << response.getStatusMessage() << endl;
|
||||
|
||||
// Launch a process using the command line
|
||||
|
||||
sts = doCommandLine( alfresco, response.getStatusMessage());
|
||||
}
|
||||
|
||||
// Check if a web browser should be launched with a URL
|
||||
|
||||
else if ( response.getStatus() == StsLaunchURL) {
|
||||
|
||||
// DEBUG
|
||||
|
||||
DBGOUT_TS << "Action returned URL, " << response.getStatusMessage() << endl;
|
||||
|
||||
// Use the Windows shell to open the URL
|
||||
|
||||
sts = doURL( alfresco, response.getStatusMessage());
|
||||
}
|
||||
|
||||
// Error status
|
||||
|
||||
else {
|
||||
|
||||
// Get the error message
|
||||
|
||||
String errMsg;
|
||||
|
||||
switch ( response.getStatus()) {
|
||||
case StsFileNotFound:
|
||||
errMsg = L"File not found";
|
||||
break;
|
||||
case StsAccessDenied:
|
||||
errMsg = L"Access denied";
|
||||
break;
|
||||
case StsBadParameter:
|
||||
errMsg = L"Bad parameter in request";
|
||||
break;
|
||||
case StsNoSuchAction:
|
||||
errMsg = L"No such action";
|
||||
break;
|
||||
default:
|
||||
errMsg = L"Error running action";
|
||||
break;
|
||||
}
|
||||
|
||||
// Display an error dialog
|
||||
|
||||
CString msg;
|
||||
|
||||
if ( response.hasStatusMessage())
|
||||
msg.FormatMessage( L"%1\n\n%2", errMsg.data(), response.getStatusMessage().data());
|
||||
else
|
||||
msg = errMsg.data();
|
||||
|
||||
AfxMessageBox( msg, MB_OK | MB_ICONERROR);
|
||||
|
||||
DBGOUT_TS << "Action returned error status, " << msg << endl;
|
||||
}
|
||||
}
|
||||
else if ( response.hasStatusMessage()) {
|
||||
|
||||
// Display the message returned by the action
|
||||
|
||||
CString msg;
|
||||
msg.FormatMessage( L"Action returned message\n\n%1", response.getStatusMessage().data());
|
||||
AfxMessageBox( msg, MB_OK | MB_ICONINFORMATION);
|
||||
|
||||
DBGOUT_TS << "Action returned error message, " << msg << endl;
|
||||
}
|
||||
}
|
||||
|
||||
// Return the action status
|
||||
|
||||
return sts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Launch a command line
|
||||
*
|
||||
* @param alfresco AlfrescoInterface&
|
||||
* @param cmdStr const String&
|
||||
* @return bool
|
||||
*/
|
||||
bool CAlfrescoApp::doCommandLine( AlfrescoInterface& alfresco, const String& cmdStr) {
|
||||
|
||||
// Check if the command line contains any environment variables/tokens
|
||||
|
||||
String cmdLine = cmdStr;
|
||||
int pos = cmdLine.indexOf( L'%');
|
||||
|
||||
if ( pos != -1) {
|
||||
|
||||
// Command line contains environment variables or other tokens that must be replaced
|
||||
|
||||
String newCmdLine = L"";
|
||||
if (pos > 0)
|
||||
newCmdLine = cmdLine.substring( 0, pos);
|
||||
|
||||
wchar_t envBuf[256];
|
||||
size_t envLen;
|
||||
|
||||
while ( pos != -1) {
|
||||
|
||||
// Find the end of the current token
|
||||
|
||||
int endPos = cmdLine.indexOf ( L'%', pos + 1);
|
||||
|
||||
if ( endPos == -1) {
|
||||
CString msg;
|
||||
msg.FormatMessage( L"Bad token in command line\n\n%1", cmdLine.data());
|
||||
AfxMessageBox( msg, MB_OK | MB_ICONERROR);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Extract the token
|
||||
|
||||
String token = cmdLine.substring( pos + 1, endPos);
|
||||
|
||||
// Replace the token with an environment variable value or other values
|
||||
|
||||
if ( token.equals( L"AlfrescoDir")) {
|
||||
|
||||
// Use the local path to the Alfresco folder that the application is running from
|
||||
|
||||
newCmdLine.append( alfresco.getUNCPath());
|
||||
}
|
||||
else {
|
||||
|
||||
// Find the environment variable value
|
||||
|
||||
envLen = sizeof( envBuf)/sizeof(wchar_t);
|
||||
const wchar_t* pEnvName = token.data();
|
||||
|
||||
if ( _wgetenv_s( &envLen, envBuf, envLen, pEnvName) == 0) {
|
||||
|
||||
// Append the environment variable value
|
||||
|
||||
newCmdLine.append( envBuf);
|
||||
}
|
||||
else {
|
||||
|
||||
// Error converting the environment variable
|
||||
|
||||
CString msg;
|
||||
msg.FormatMessage( L"Failed to convert environment variable\n\n%1\n\n%2", token.data(), cmdLine.data());
|
||||
AfxMessageBox( msg, MB_OK | MB_ICONERROR);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Update the token search position
|
||||
|
||||
pos = endPos + 1;
|
||||
|
||||
if (( unsigned int) pos < cmdStr.length()) {
|
||||
|
||||
// Search for the next token
|
||||
|
||||
pos = cmdLine.indexOf( L'%', pos);
|
||||
}
|
||||
else {
|
||||
|
||||
// End of string, finish the token search
|
||||
|
||||
pos = -1;
|
||||
}
|
||||
|
||||
// Append the normal string between tokens
|
||||
|
||||
if ( pos > (endPos + 1)) {
|
||||
|
||||
// Get the between token sting
|
||||
|
||||
String filler = cmdLine.substring( endPos + 1, pos);
|
||||
newCmdLine.append( filler);
|
||||
}
|
||||
else if ( pos == -1) {
|
||||
|
||||
// Append the remaining string
|
||||
|
||||
String filler = cmdLine.substring( endPos + 1);
|
||||
newCmdLine.append( filler);
|
||||
}
|
||||
}
|
||||
|
||||
// Update the command line
|
||||
|
||||
cmdLine = newCmdLine;
|
||||
}
|
||||
|
||||
// Initialize the startup information
|
||||
|
||||
STARTUPINFO startupInfo;
|
||||
memset(&startupInfo, 0, sizeof(STARTUPINFO));
|
||||
|
||||
// Launch a process using the command line
|
||||
|
||||
PROCESS_INFORMATION processInfo;
|
||||
memset(&processInfo, 0, sizeof(PROCESS_INFORMATION));
|
||||
|
||||
bool sts = false;
|
||||
|
||||
if ( CreateProcess( NULL, (LPWSTR) cmdLine.data(), NULL, NULL, true, 0, NULL, NULL,
|
||||
&startupInfo, &processInfo) == false) {
|
||||
CString msg;
|
||||
msg.FormatMessage( L"Failed to launch command line\n\n%1\n\nError %2!d!", cmdLine.data(), GetLastError());
|
||||
AfxMessageBox( msg, MB_OK | MB_ICONERROR);
|
||||
|
||||
// DEBUG
|
||||
|
||||
DBGOUT_TS << "Error, failed to launch command line, status " << GetLastError() << endl;
|
||||
}
|
||||
else
|
||||
sts = true;
|
||||
|
||||
return sts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Browse to a URL
|
||||
*
|
||||
* @param alfresco AlfrescoInterface&
|
||||
* @param url const String&
|
||||
* @return bool
|
||||
*/
|
||||
bool CAlfrescoApp::doURL( AlfrescoInterface& alfresco, const String& url) {
|
||||
|
||||
// Use the Windows shell to open the URL
|
||||
|
||||
bool sts = false;
|
||||
|
||||
HINSTANCE shellSts = ShellExecute( NULL, NULL, url.data(), NULL, NULL, SW_SHOWNORMAL);
|
||||
if (( int) shellSts < 32) {
|
||||
CString msg;
|
||||
msg.FormatMessage( L"Failed to launch URL\n\n%1", url.data());
|
||||
AfxMessageBox( msg, MB_OK | MB_ICONERROR);
|
||||
}
|
||||
else
|
||||
sts = true;
|
||||
|
||||
return sts;
|
||||
}
|
71
repository/src/main/cpp/CAlfrescoApp/CAlfrescoApp.h
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef __AFXWIN_H__
|
||||
#error include 'stdafx.h' before including this file for PCH
|
||||
#endif
|
||||
|
||||
#include "resource.h" // main symbols
|
||||
|
||||
// Includes
|
||||
|
||||
#include "alfresco\Alfresco.hpp"
|
||||
#include "alfresco\Desktop.hpp"
|
||||
|
||||
using namespace Alfresco;
|
||||
|
||||
// CAlfrescoApp:
|
||||
// See CAlfrescoApp.cpp for the implementation of this class
|
||||
//
|
||||
|
||||
class CAlfrescoApp : public CWinApp
|
||||
{
|
||||
public:
|
||||
CAlfrescoApp();
|
||||
|
||||
// Overrides
|
||||
public:
|
||||
virtual BOOL InitInstance();
|
||||
|
||||
// Implementation
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
|
||||
private:
|
||||
// Main Alfresco interface functions
|
||||
|
||||
bool buildDesktopParameters( AlfrescoInterface& alfresco, StringList& paths, AlfrescoActionInfo& actionInfo, DesktopParams& params);
|
||||
|
||||
// Copy files/folders using the Windows shell
|
||||
|
||||
bool copyFilesUsingShell(const String& fromPath, const String& toPath, bool& aborted);
|
||||
|
||||
// Run the action
|
||||
|
||||
bool runAction( AlfrescoInterface& alfresco, StringList& pathList, AlfrescoActionInfo& actionInfo);
|
||||
|
||||
// Post-process actions, command line launch and browse to URL
|
||||
|
||||
bool doCommandLine( AlfrescoInterface& alfresco, const String& cmdLine);
|
||||
bool doURL( AlfrescoInterface& alfresco, const String& url);
|
||||
};
|
||||
|
||||
extern CAlfrescoApp theApp;
|
19
repository/src/main/cpp/CAlfrescoApp/CAlfrescoApp.htm
Normal file
@@ -0,0 +1,19 @@
|
||||
<HTML>
|
||||
<BODY ID=CCAlfrescoAppDlg BGCOLOR=LIGHTGREY>
|
||||
|
||||
<TABLE WIDTH=100%>
|
||||
<TR>
|
||||
<TD ALIGN=RIGHT>
|
||||
<BUTTON STYLE="WIDTH:100" ID="ButtonOK">OK</BUTTON><BR>
|
||||
<BUTTON STYLE="WIDTH:100" ID="ButtonCancel">Cancel</BUTTON>
|
||||
</TD>
|
||||
</TR>
|
||||
<TR WIDTH=100% HEIGHT=75>
|
||||
<TD ALIGN=CENTER VALIGN=BOTTOM>
|
||||
TODO: Place controls here.
|
||||
</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
BIN
repository/src/main/cpp/CAlfrescoApp/CAlfrescoApp.ncb
Normal file
255
repository/src/main/cpp/CAlfrescoApp/CAlfrescoApp.rc
Normal file
@@ -0,0 +1,255 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_ABOUTBOX DIALOGEX 0, 0, 235, 55
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "About CAlfrescoApp"
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||
BEGIN
|
||||
ICON 128,IDC_STATIC,11,17,20,20
|
||||
LTEXT "CAlfrescoApp Version 1.0",IDC_STATIC,40,10,119,8,SS_NOPREFIX
|
||||
LTEXT "Copyright (C) 2005",IDC_STATIC,40,25,119,8
|
||||
DEFPUSHBUTTON "OK",IDOK,178,7,50,16,WS_GROUP
|
||||
END
|
||||
|
||||
IDD_CALFRESCOAPP_DIALOG DIALOGEX 0, 0, 469, 156
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
EXSTYLE WS_EX_APPWINDOW
|
||||
CAPTION "Alfresco Check In/Out"
|
||||
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||
BEGIN
|
||||
PUSHBUTTON "OK",IDOK,209,130,50,13
|
||||
LTEXT "Checked in 99 files",IDC_MSGTEXT,25,22,418,8
|
||||
LISTBOX IDC_FILELIST,23,38,424,83,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// HTML
|
||||
//
|
||||
|
||||
IDR_HTML_CALFRESCOAPP_DIALOG HTML "CAlfrescoApp.htm"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 1,0,0,1
|
||||
PRODUCTVERSION 1,0,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x1L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "040904e4"
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Alfresco"
|
||||
VALUE "FileDescription", "Alfresco Drag And Drop"
|
||||
VALUE "FileVersion", "1.0.0.2"
|
||||
VALUE "InternalName", "CAlfrescoApp.exe"
|
||||
VALUE "LegalCopyright", "(c) Alfresco. All rights reserved."
|
||||
VALUE "OriginalFilename", "CAlfrescoApp.exe"
|
||||
VALUE "ProductName", "Alfresco"
|
||||
VALUE "ProductVersion", "1.0.0.2"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x409, 1252
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO
|
||||
BEGIN
|
||||
IDD_ABOUTBOX, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 228
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 48
|
||||
END
|
||||
|
||||
IDD_CALFRESCOAPP_DIALOG, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 462
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 149
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_ABOUTBOX "&About CAlfrescoApp..."
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
AFX_IDS_APP_TITLE "Alfresco Desktop Action"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.K.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_FILESTATUS DIALOGEX 0, 0, 448, 332
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Alfresco File Status"
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK",IDOK,391,311,50,14
|
||||
CONTROL "",IDC_FILELIST,"SysListView32",LVS_REPORT | LVS_ALIGNLEFT | WS_BORDER | WS_TABSTOP,7,7,434,299
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO
|
||||
BEGIN
|
||||
IDD_FILESTATUS, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 441
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 325
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||
"\r\n"
|
||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
|
||||
"LANGUAGE 9, 1\r\n"
|
||||
"#pragma code_page(1252)\r\n"
|
||||
"#include ""res\\CAlfrescoApp.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
|
||||
"#include ""afxres.rc"" // Standard components\r\n"
|
||||
"#endif\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_ICON1 ICON "alfresco.ico"
|
||||
#endif // English (U.K.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#define _AFX_NO_SPLITTER_RESOURCES
|
||||
#define _AFX_NO_OLE_RESOURCES
|
||||
#define _AFX_NO_TRACKER_RESOURCES
|
||||
#define _AFX_NO_PROPERTY_RESOURCES
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
LANGUAGE 9, 1
|
||||
#pragma code_page(1252)
|
||||
#include "res\CAlfrescoApp.rc2" // non-Microsoft Visual C++ edited resources
|
||||
#include "afxres.rc" // Standard components
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
19
repository/src/main/cpp/CAlfrescoApp/CAlfrescoApp.sln
Normal file
@@ -0,0 +1,19 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CAlfrescoApp", "CAlfrescoApp.vcproj", "{055DCC85-2D1A-4594-B2BE-ED292D2BF26D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{055DCC85-2D1A-4594-B2BE-ED292D2BF26D}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{055DCC85-2D1A-4594-B2BE-ED292D2BF26D}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{055DCC85-2D1A-4594-B2BE-ED292D2BF26D}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{055DCC85-2D1A-4594-B2BE-ED292D2BF26D}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
BIN
repository/src/main/cpp/CAlfrescoApp/CAlfrescoApp.suo
Normal file
420
repository/src/main/cpp/CAlfrescoApp/CAlfrescoApp.vcproj
Normal file
@@ -0,0 +1,420 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="CAlfrescoApp"
|
||||
ProjectGUID="{055DCC85-2D1A-4594-B2BE-ED292D2BF26D}"
|
||||
RootNamespace="CAlfrescoApp"
|
||||
Keyword="MFCProj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="false"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=".\includes"
|
||||
PreprocessorDefinitions="UNICODE,_CRT_SECURE_NO_DEPRECATE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
TreatWChar_tAsBuiltInType="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="mpr.lib shell32.lib"
|
||||
OutputFile="$(OutDir)/Alfresco.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="false"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=".\includes"
|
||||
PreprocessorDefinitions="UNICODE,_CRT_SECURE_NO_DEPRECATE"
|
||||
MinimalRebuild="false"
|
||||
RuntimeLibrary="2"
|
||||
TreatWChar_tAsBuiltInType="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="mpr.lib shell32.lib"
|
||||
OutputFile="$(OutDir)/Alfresco.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\CAlfrescoApp.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CAlfrescoAppDlg.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<Filter
|
||||
Name="util"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\source\util\ByteArray.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\util\DataBuffer.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\util\DataPacker.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\util\Exception.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\util\FileName.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\util\Integer.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\util\Long.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\util\String.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\util\System.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="alfresco"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\source\alfresco\Alfresco.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\source\alfresco\Desktop.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\CAlfrescoApp.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CAlfrescoAppDlg.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\Resource.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\stdafx.h"
|
||||
>
|
||||
</File>
|
||||
<Filter
|
||||
Name="util"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\includes\util\ByteArray.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\includes\util\DataBuffer.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\includes\util\DataPacker.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\includes\util\Exception.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\includes\util\FileName.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\includes\util\Integer.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\includes\util\JavaTypes.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\includes\util\Long.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\includes\util\String.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\includes\util\System.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\includes\util\Types.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="alfresco"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\includes\alfresco\Alfresco.hpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\includes\alfresco\Desktop.hpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\alfresco.ico"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\res\CAlfrescoApp.ico"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\CAlfrescoApp.rc"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\res\CAlfrescoApp.rc2"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<File
|
||||
RelativePath=".\CAlfrescoApp.htm"
|
||||
DeploymentContent="true"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\res\CAlfrescoApp.manifest"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\ReadMe.txt"
|
||||
>
|
||||
</File>
|
||||
</Files>
|
||||
<Globals>
|
||||
<Global
|
||||
Name="RESOURCE_FILE"
|
||||
Value="CAlfrescoApp.rc"
|
||||
/>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
159
repository/src/main/cpp/CAlfrescoApp/CAlfrescoAppDlg.cpp
Normal file
@@ -0,0 +1,159 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "CAlfrescoApp.h"
|
||||
#include "CAlfrescoAppDlg.h"
|
||||
#include ".\calfrescoappdlg.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
|
||||
|
||||
// CAboutDlg dialog used for App About
|
||||
|
||||
class CAboutDlg : public CDialog
|
||||
{
|
||||
public:
|
||||
CAboutDlg();
|
||||
|
||||
// Dialog Data
|
||||
enum { IDD = IDD_ABOUTBOX };
|
||||
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
|
||||
{
|
||||
}
|
||||
|
||||
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
CCAlfrescoAppDlg::CCAlfrescoAppDlg(CWnd* pParent /*=NULL*/)
|
||||
: CDialog( CCAlfrescoAppDlg::IDD, pParent)
|
||||
{
|
||||
m_hIcon = AfxGetApp()->LoadIcon(IDI_ICON1);
|
||||
}
|
||||
|
||||
void CCAlfrescoAppDlg::DoDataExchange(CDataExchange* pDX)
|
||||
{
|
||||
CDialog::DoDataExchange(pDX);
|
||||
}
|
||||
|
||||
BEGIN_MESSAGE_MAP(CCAlfrescoAppDlg, CDialog)
|
||||
ON_WM_SYSCOMMAND()
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
|
||||
// CCAlfrescoAppDlg message handlers
|
||||
|
||||
BOOL CCAlfrescoAppDlg::OnInitDialog()
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// Add "About..." menu item to system menu.
|
||||
|
||||
// IDM_ABOUTBOX must be in the system command range.
|
||||
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
|
||||
ASSERT(IDM_ABOUTBOX < 0xF000);
|
||||
|
||||
CMenu* pSysMenu = GetSystemMenu(FALSE);
|
||||
if (pSysMenu != NULL)
|
||||
{
|
||||
CString strAboutMenu;
|
||||
strAboutMenu.LoadString(IDS_ABOUTBOX);
|
||||
if (!strAboutMenu.IsEmpty())
|
||||
{
|
||||
pSysMenu->AppendMenu(MF_SEPARATOR);
|
||||
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
|
||||
}
|
||||
}
|
||||
|
||||
// Set the icon for this dialog. The framework does this automatically
|
||||
// when the application's main window is not a dialog
|
||||
SetIcon(m_hIcon, TRUE); // Set big icon
|
||||
SetIcon(m_hIcon, FALSE); // Set small icon
|
||||
|
||||
// TODO: Add extra initialization here
|
||||
|
||||
return TRUE; // return TRUE unless you set the focus to a control
|
||||
}
|
||||
|
||||
void CCAlfrescoAppDlg::OnSysCommand(UINT nID, LPARAM lParam)
|
||||
{
|
||||
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
|
||||
{
|
||||
CAboutDlg dlgAbout;
|
||||
dlgAbout.DoModal();
|
||||
}
|
||||
else
|
||||
{
|
||||
CDialog::OnSysCommand(nID, lParam);
|
||||
}
|
||||
}
|
||||
|
||||
// If you add a minimize button to your dialog, you will need the code below
|
||||
// to draw the icon. For MFC applications using the document/view model,
|
||||
// this is automatically done for you by the framework.
|
||||
|
||||
void CCAlfrescoAppDlg::OnPaint()
|
||||
{
|
||||
if (IsIconic())
|
||||
{
|
||||
CPaintDC dc(this); // device context for painting
|
||||
|
||||
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
|
||||
|
||||
// Center icon in client rectangle
|
||||
int cxIcon = GetSystemMetrics(SM_CXICON);
|
||||
int cyIcon = GetSystemMetrics(SM_CYICON);
|
||||
CRect rect;
|
||||
GetClientRect(&rect);
|
||||
int x = (rect.Width() - cxIcon + 1) / 2;
|
||||
int y = (rect.Height() - cyIcon + 1) / 2;
|
||||
|
||||
// Draw the icon
|
||||
dc.DrawIcon(x, y, m_hIcon);
|
||||
}
|
||||
else
|
||||
{
|
||||
CDialog::OnPaint();
|
||||
}
|
||||
}
|
||||
|
||||
// The system calls this function to obtain the cursor to display while the user drags
|
||||
// the minimized window.
|
||||
HCURSOR CCAlfrescoAppDlg::OnQueryDragIcon()
|
||||
{
|
||||
return static_cast<HCURSOR>(m_hIcon);
|
||||
}
|
46
repository/src/main/cpp/CAlfrescoApp/CAlfrescoAppDlg.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
// CCAlfrescoAppDlg dialog
|
||||
class CCAlfrescoAppDlg : public CDialog
|
||||
{
|
||||
// Construction
|
||||
public:
|
||||
CCAlfrescoAppDlg(CWnd* pParent = NULL); // standard constructor
|
||||
|
||||
// Dialog Data
|
||||
enum { IDD = IDD_CALFRESCOAPP_DIALOG };
|
||||
|
||||
protected:
|
||||
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
|
||||
|
||||
// Implementation
|
||||
protected:
|
||||
HICON m_hIcon;
|
||||
|
||||
// Generated message map functions
|
||||
virtual BOOL OnInitDialog();
|
||||
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
|
||||
afx_msg void OnPaint();
|
||||
afx_msg HCURSOR OnQueryDragIcon();
|
||||
DECLARE_MESSAGE_MAP()
|
||||
public:
|
||||
};
|
90
repository/src/main/cpp/CAlfrescoApp/ReadMe.txt
Normal file
@@ -0,0 +1,90 @@
|
||||
================================================================================
|
||||
MICROSOFT FOUNDATION CLASS LIBRARY : CAlfrescoApp Project Overview
|
||||
===============================================================================
|
||||
|
||||
The application wizard has created this CAlfrescoApp application for
|
||||
you. This application not only demonstrates the basics of using the Microsoft
|
||||
Foundation Classes but is also a starting point for writing your application.
|
||||
|
||||
This file contains a summary of what you will find in each of the files that
|
||||
make up your CAlfrescoApp application.
|
||||
|
||||
CAlfrescoApp.vcproj
|
||||
This is the main project file for VC++ projects generated using an application wizard.
|
||||
It contains information about the version of Visual C++ that generated the file, and
|
||||
information about the platforms, configurations, and project features selected with the
|
||||
application wizard.
|
||||
|
||||
CAlfrescoApp.h
|
||||
This is the main header file for the application. It includes other
|
||||
project specific headers (including Resource.h) and declares the
|
||||
CCAlfrescoAppApp application class.
|
||||
|
||||
CAlfrescoApp.cpp
|
||||
This is the main application source file that contains the application
|
||||
class CCAlfrescoAppApp.
|
||||
|
||||
CAlfrescoApp.rc
|
||||
This is a listing of all of the Microsoft Windows resources that the
|
||||
program uses. It includes the icons, bitmaps, and cursors that are stored
|
||||
in the RES subdirectory. This file can be directly edited in Microsoft
|
||||
Visual C++. Your project resources are in 1033.
|
||||
|
||||
res\CAlfrescoApp.ico
|
||||
This is an icon file, which is used as the application's icon. This
|
||||
icon is included by the main resource file CAlfrescoApp.rc.
|
||||
|
||||
res\CAlfrescoApp.rc2
|
||||
This file contains resources that are not edited by Microsoft
|
||||
Visual C++. You should place all resources not editable by
|
||||
the resource editor in this file.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
The application wizard creates one dialog class:
|
||||
CAlfrescoAppDlg.h, CAlfrescoAppDlg.cpp - the dialog
|
||||
These files contain your CCAlfrescoAppDlg class. This class defines
|
||||
the behavior of your application's main dialog. The dialog's template is
|
||||
in CAlfrescoApp.rc, which can be edited in Microsoft Visual C++.
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Other Features:
|
||||
|
||||
ActiveX Controls
|
||||
The application includes support to use ActiveX controls.
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Other standard files:
|
||||
|
||||
StdAfx.h, StdAfx.cpp
|
||||
These files are used to build a precompiled header (PCH) file
|
||||
named CAlfrescoApp.pch and a precompiled types file named StdAfx.obj.
|
||||
|
||||
Resource.h
|
||||
This is the standard header file, which defines new resource IDs.
|
||||
Microsoft Visual C++ reads and updates this file.
|
||||
|
||||
CAlfrescoApp.manifest
|
||||
Application manifest files are used by Windows XP to describe an applications
|
||||
dependency on specific versions of Side-by-Side assemblies. The loader uses this
|
||||
information to load the appropriate assembly from the assembly cache or private
|
||||
from the application. The Application manifest maybe included for redistribution
|
||||
as an external .manifest file that is installed in the same folder as the application
|
||||
executable or it may be included in the executable in the form of a resource.
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Other notes:
|
||||
|
||||
The application wizard uses "TODO:" to indicate parts of the source code you
|
||||
should add to or customize.
|
||||
|
||||
If your application uses MFC in a shared DLL, and your application is in a
|
||||
language other than the operating system's current language, you will need
|
||||
to copy the corresponding localized resources MFC70XXX.DLL from the Microsoft
|
||||
Visual C++ CD-ROM under the Win\System directory to your computer's system or
|
||||
system32 directory, and rename it to be MFCLOC.DLL. ("XXX" stands for the
|
||||
language abbreviation. For example, MFC70DEU.DLL contains resources
|
||||
translated to German.) If you don't do this, some of the UI elements of
|
||||
your application will remain in the language of the operating system.
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
BIN
repository/src/main/cpp/CAlfrescoApp/alfresco.ico
Normal file
After Width: | Height: | Size: 894 B |
@@ -0,0 +1,427 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _Alfresco_H
|
||||
#define _Alfresco_H
|
||||
|
||||
// Includes
|
||||
|
||||
#include <windows.h>
|
||||
#include <WinIOCtl.h>
|
||||
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
#include "util\Exception.h"
|
||||
#include "util\String.h"
|
||||
#include "util\DataBuffer.h"
|
||||
|
||||
#include "alfresco\Desktop.hpp"
|
||||
|
||||
// Classes defined in this header file
|
||||
|
||||
namespace Alfresco {
|
||||
class AlfrescoInterface;
|
||||
class AlfrescoFileInfo;
|
||||
class AlfrescoFileInfoList;
|
||||
class AlfrescoActionInfo;
|
||||
typedef std::auto_ptr<AlfrescoFileInfo> PTR_AlfrescoFileInfo;
|
||||
typedef std::auto_ptr<AlfrescoActionInfo> PTR_AlfrescoActionInfo;
|
||||
}
|
||||
|
||||
// Constants
|
||||
|
||||
namespace Alfresco {
|
||||
|
||||
// Alfresco I/O control codes
|
||||
|
||||
#define FSCTL_ALFRESCO_PROBE CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 0x800, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define FSCTL_ALFRESCO_FILESTS CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 0x801, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
// Version 1 FSCTL_ALFRESCO_CHECKOUT - 0x802
|
||||
// Version 1 FSCTL_ALFRESCO_CHECKIN - 0x803
|
||||
#define FSCTL_ALFRESCO_GETACTIONINFO CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 0x804, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define FSCTL_ALFRESCO_RUNACTION CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 0x805, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
#define FSCTL_ALFRESCO_GETAUTHTICKET CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 0x806, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
||||
|
||||
// Request signature bytes
|
||||
|
||||
#define IOSignature "ALFRESCO"
|
||||
#define IOSignatureLen 8
|
||||
|
||||
// Path prefixes/components
|
||||
|
||||
#define UNCPathPrefix L"\\\\"
|
||||
#define PathSeperator L"\\"
|
||||
|
||||
// I/O control status codes
|
||||
|
||||
#define StsSuccess 0
|
||||
|
||||
#define StsError 1
|
||||
#define StsFileNotFound 2
|
||||
#define StsAccessDenied 3
|
||||
#define StsBadParameter 4
|
||||
#define StsNotWorkingCopy 5
|
||||
#define StsNoSuchAction 6
|
||||
#define StsLaunchURL 7
|
||||
#define StsCommandLine 8
|
||||
#define StsAuthTicket 9
|
||||
|
||||
// Boolean field values
|
||||
|
||||
#define True 1
|
||||
#define False 0
|
||||
|
||||
// File status field values
|
||||
//
|
||||
// Node type
|
||||
|
||||
#define TypeFile 0
|
||||
#define TypeFolder 1
|
||||
|
||||
// Lock status
|
||||
|
||||
#define LockNone 0
|
||||
#define LockRead 1
|
||||
#define LockWrite 2
|
||||
|
||||
// Desktop action attributes
|
||||
|
||||
#define AttrTargetFiles 0x0001
|
||||
#define AttrTargetFolders 0x0002
|
||||
#define AttrClientFiles 0x0004
|
||||
#define AttrClientFolders 0x0008
|
||||
#define AttrAlfrescoFiles 0x0010
|
||||
#define AttrAlfrescoFolders 0x0020
|
||||
#define AttrMultiplePaths 0x0040
|
||||
#define AttrAllowNoParams 0x0080
|
||||
|
||||
#define AttrAnyFiles (AttrTargetFiles + AttrClientFiles + AttrAlfrescoFiles)
|
||||
#define AttrAnyFolders (AttrTargetFolders + AttrClientFolders + AttrAlfrescoFolders)
|
||||
#define AttrAnyFilesFolders (AttrAnyFiles + AttrAnyFolders)
|
||||
|
||||
// Desktop action pre-processing actions
|
||||
|
||||
#define PreCopyToTarget 0x0001
|
||||
#define PreConfirmAction 0x0002
|
||||
#define PreLocalToWorkingCopy 0x0004
|
||||
}
|
||||
|
||||
// Define Alfresco interface exceptions
|
||||
|
||||
DEFINE_EXCEPTION(Alfresco, BadInterfaceException);
|
||||
|
||||
/**
|
||||
* Alfresco API Class
|
||||
*
|
||||
* Provides the interface to an Alfresco CIFS server to perform Alfresco specific functions
|
||||
* not available via the normal file I/O functions.
|
||||
*/
|
||||
class Alfresco::AlfrescoInterface {
|
||||
public:
|
||||
// Class constructors
|
||||
|
||||
AlfrescoInterface(String& path);
|
||||
|
||||
// Class destructor
|
||||
|
||||
~AlfrescoInterface();
|
||||
|
||||
// Return the UNC path and root path
|
||||
|
||||
inline const String& getUNCPath( void) const { return m_uncPath; }
|
||||
inline const String& getRootPath( void) const { return m_rootPath; }
|
||||
|
||||
// Check if the application is running from a mapped drive, return the drive path
|
||||
|
||||
inline bool isMappedDrive( void) const { return m_mappedDrive.length() > 0 ? true : false; }
|
||||
inline const String& getDrivePath( void) const { return m_mappedDrive; }
|
||||
|
||||
// Check if the path is on an Alfresco CIFS server
|
||||
|
||||
bool isAlfrescoFolder( void);
|
||||
|
||||
// Return the protocol version of the server
|
||||
|
||||
inline const unsigned int isProtocolVersion( void) const { return m_protocolVersion; }
|
||||
|
||||
// Return the Alfresco file information for a file/folder within the current folder
|
||||
|
||||
PTR_AlfrescoFileInfo getFileInformation(const wchar_t* fileName);
|
||||
|
||||
// Get action information, map the executable name to a server action
|
||||
|
||||
AlfrescoActionInfo getActionInformation(const wchar_t* exeName);
|
||||
|
||||
// Run a desktop action and return the server response
|
||||
|
||||
DesktopResponse runAction(AlfrescoActionInfo& action, DesktopParams& params);
|
||||
|
||||
// Set the root path to be used as the working directory
|
||||
|
||||
bool setRootPath( const wchar_t* rootPath);
|
||||
|
||||
// Return the authentication ticket for this session
|
||||
|
||||
DesktopResponse getAuthenticationTicket( void);
|
||||
|
||||
private:
|
||||
// Send an I/O control request, receive and validate the response
|
||||
|
||||
void sendIOControl( const unsigned int ctlCode, DataBuffer& reqbuf, DataBuffer& respbuf);
|
||||
|
||||
private:
|
||||
// Hide the copy constructor
|
||||
|
||||
AlfrescoInterface(const AlfrescoInterface& alfresco) {};
|
||||
|
||||
private:
|
||||
// Instance variables
|
||||
//
|
||||
// UNC path and root path
|
||||
|
||||
String m_uncPath;
|
||||
String m_rootPath;
|
||||
|
||||
// Local path letter if running from a mapped drive
|
||||
|
||||
String m_mappedDrive;
|
||||
|
||||
// Handle to folder
|
||||
|
||||
HANDLE m_handle;
|
||||
|
||||
// Protocol version
|
||||
|
||||
unsigned int m_protocolVersion;
|
||||
};
|
||||
|
||||
/**
|
||||
* Alfresco File Information Class
|
||||
*
|
||||
* Contains Alfresco specific file information for a file/folder on an Alfresco CIFS server.
|
||||
*/
|
||||
class Alfresco::AlfrescoFileInfo {
|
||||
public:
|
||||
// Class constructor
|
||||
|
||||
AlfrescoFileInfo( const wchar_t* fName);
|
||||
|
||||
// Return the file/folder name
|
||||
|
||||
inline const String& getName( void) const { return m_name; }
|
||||
|
||||
// Determine if the file is a file or folder
|
||||
|
||||
inline unsigned int isType( void) const { return m_type; }
|
||||
|
||||
// Return the working copy status, owner, copied from
|
||||
|
||||
inline bool isWorkingCopy( void) const { return m_workingCopy; }
|
||||
inline const String& getCopyOwner( void) const { return m_workOwner; }
|
||||
inline const String& getCopiedFrom( void) const { return m_copiedFrom; }
|
||||
|
||||
// Return the lock status
|
||||
|
||||
inline unsigned int getLockType( void) const { return m_lockType; }
|
||||
inline const String& getLockOwner( void) const { return m_lockOwner; }
|
||||
|
||||
// Return the content details
|
||||
|
||||
inline bool hasContent( void) const { return m_hasContent; }
|
||||
inline LONG64 getContentLength( void) const { return m_contentLen; }
|
||||
inline const String& getContentType( void) const { return m_contentMimeType; }
|
||||
|
||||
// Set the file/folder type
|
||||
|
||||
inline void setType( unsigned int typ) { m_type = typ; }
|
||||
|
||||
// Set the working copy owner and copied from
|
||||
|
||||
void setWorkingCopy( const wchar_t* owner, const wchar_t* copiedFrom);
|
||||
|
||||
// Set the lock type and owner
|
||||
|
||||
void setLockType( unsigned int typ, const wchar_t* owner = L"");
|
||||
|
||||
// Set the content length and type
|
||||
|
||||
void setContent( LONG64 siz, const wchar_t* mimeType);
|
||||
|
||||
// Operators
|
||||
|
||||
bool operator==( const AlfrescoFileInfo& finfo);
|
||||
bool operator<( const AlfrescoFileInfo& finfo);
|
||||
|
||||
private:
|
||||
// Hide the copy constructor
|
||||
|
||||
AlfrescoFileInfo(const AlfrescoFileInfo& aInfo) {};
|
||||
|
||||
private:
|
||||
// Instance variables
|
||||
//
|
||||
// File/folder name
|
||||
|
||||
String m_name;
|
||||
unsigned int m_type;
|
||||
|
||||
// Working copy flag, owner and copied from
|
||||
|
||||
bool m_workingCopy;
|
||||
String m_workOwner;
|
||||
String m_copiedFrom;
|
||||
|
||||
// Lock type and owner
|
||||
|
||||
unsigned int m_lockType;
|
||||
String m_lockOwner;
|
||||
|
||||
// Content mime-type and length
|
||||
|
||||
bool m_hasContent;
|
||||
LONG64 m_contentLen;
|
||||
String m_contentMimeType;
|
||||
};
|
||||
|
||||
/**
|
||||
* Alfresco File Info List Class
|
||||
*/
|
||||
class Alfresco::AlfrescoFileInfoList {
|
||||
public:
|
||||
// Class constructor
|
||||
|
||||
AlfrescoFileInfoList( void) {};
|
||||
|
||||
// Add a file information object to the list
|
||||
|
||||
inline void addInfo( AlfrescoFileInfo* pInfo) { m_list.push_back( pInfo); }
|
||||
inline void addInfo( PTR_AlfrescoFileInfo pInfo) { if ( pInfo.get() != NULL) m_list.push_back( pInfo.release()); }
|
||||
|
||||
// Return the number of objects in the list
|
||||
|
||||
inline size_t size( void) const { return m_list.size(); }
|
||||
|
||||
// Return the specified file information
|
||||
|
||||
inline const AlfrescoFileInfo* getInfoAt( unsigned int idx) const { return m_list[idx]; }
|
||||
|
||||
// Assignment operator
|
||||
|
||||
inline AlfrescoFileInfo*& operator[] ( const unsigned int idx) { return m_list[idx]; }
|
||||
|
||||
// Remove all objects from the list
|
||||
|
||||
inline void clear( void) { for ( unsigned int i = 0; i < m_list.size(); delete m_list[i++]); m_list.clear(); }
|
||||
|
||||
// Return the vector
|
||||
|
||||
std::vector<AlfrescoFileInfo*> getList( void) { return m_list; }
|
||||
|
||||
private:
|
||||
// Instance variables
|
||||
//
|
||||
// List of file information objects
|
||||
|
||||
std::vector<AlfrescoFileInfo*> m_list;
|
||||
};
|
||||
|
||||
/**
|
||||
* Alfresco Action Info Class
|
||||
*/
|
||||
class Alfresco::AlfrescoActionInfo {
|
||||
public:
|
||||
// Default constructor
|
||||
|
||||
AlfrescoActionInfo(void);
|
||||
|
||||
// Class constructor
|
||||
|
||||
AlfrescoActionInfo( const String& name, const unsigned int attr, const unsigned int preActions);
|
||||
|
||||
// Return the action name, pseudo file name
|
||||
|
||||
inline const String& getName(void) const { return m_name; }
|
||||
inline const String& getPseudoName(void) const { return m_pseudoName; }
|
||||
|
||||
// Return the action attributes, action pre-processing flags
|
||||
|
||||
inline unsigned int getAttributes(void) const { return m_attributes; }
|
||||
inline unsigned int getPreProcessActions(void) const { return m_clientPreActions; }
|
||||
|
||||
// Check if the action has the specifed attribute/pre-processing action
|
||||
|
||||
inline bool hasAttribute(const unsigned int attr) const { return (m_attributes & attr) != 0 ? true : false; }
|
||||
inline bool hasPreProcessAction(const unsigned int pre) const { return (m_clientPreActions & pre) != 0 ? true : false; }
|
||||
|
||||
// Check if the confirmation message is valid, return the confirmation message
|
||||
|
||||
inline bool hasConfirmationMessage(void) const { return m_confirmMsg.length() > 0 ? true : false; }
|
||||
inline const String& getConfirmationMessage(void) const { return m_confirmMsg; }
|
||||
|
||||
// Check if the action supports file or folder paths
|
||||
|
||||
inline bool supportsFiles(void) const { return hasAttribute(AttrTargetFiles+AttrClientFiles+AttrAlfrescoFiles); }
|
||||
inline bool supportsFolders(void) const { return hasAttribute(AttrTargetFolders+AttrClientFolders+AttrAlfrescoFolders); }
|
||||
|
||||
// Check if the action allows no parameters
|
||||
|
||||
inline bool allowsNoParameters(void) const { return hasAttribute(AttrAllowNoParams) || hasAttribute(AttrAnyFilesFolders) == false; }
|
||||
|
||||
// Set the action name, pseudo name, set the confirmation message
|
||||
|
||||
inline void setName(const String& name) { m_name = name; }
|
||||
inline void setPseudoName(const String& pseudo) { m_pseudoName = pseudo; }
|
||||
inline void setConfirmationMessage(const String& msg) { m_confirmMsg = msg; }
|
||||
|
||||
// Set the action attributes and pre-processing actions
|
||||
|
||||
inline void setAttributes(const unsigned int attr) { m_attributes = attr; }
|
||||
inline void setPreProcessActions(const unsigned int pre) { m_clientPreActions = pre; }
|
||||
|
||||
// Return the action information as a string
|
||||
|
||||
const String toString(void) const;
|
||||
|
||||
// Assignment operator
|
||||
|
||||
AlfrescoActionInfo& operator=( const AlfrescoActionInfo& actionInfo);
|
||||
|
||||
private:
|
||||
// Instance variables
|
||||
//
|
||||
// Action name
|
||||
|
||||
String m_name;
|
||||
|
||||
// Pseudo file name
|
||||
|
||||
String m_pseudoName;
|
||||
|
||||
// Action attributes and pre-processing flags
|
||||
|
||||
unsigned int m_attributes;
|
||||
unsigned int m_clientPreActions;
|
||||
|
||||
// Action confirmation message
|
||||
|
||||
String m_confirmMsg;
|
||||
};
|
||||
|
||||
#endif
|
181
repository/src/main/cpp/CAlfrescoApp/includes/alfresco/Desktop.hpp
Executable file
@@ -0,0 +1,181 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _Desktop_H
|
||||
#define _Desktop_H
|
||||
|
||||
// Includes
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include "util\Exception.h"
|
||||
#include "util\String.h"
|
||||
#include "util\DataBuffer.h"
|
||||
|
||||
// Classes defined in this header file
|
||||
|
||||
namespace Alfresco {
|
||||
class DesktopTarget;
|
||||
class DesktopParams;
|
||||
class DesktopResponse;
|
||||
|
||||
typedef std::auto_ptr<DesktopTarget> PTR_DesktopTarget;
|
||||
typedef std::auto_ptr<DesktopParams> PTR_DesktopParams;
|
||||
typedef std::auto_ptr<DesktopResponse> PTR_DesktopResponse;
|
||||
}
|
||||
|
||||
// Constants
|
||||
|
||||
namespace Alfresco {
|
||||
|
||||
// Desktop target types
|
||||
|
||||
#define TargetFile 0
|
||||
#define TargetFolder 1
|
||||
#define TargetCopiedFile 2
|
||||
#define TargetCopiedFolder 3
|
||||
#define TargetNodeRef 4
|
||||
}
|
||||
|
||||
// Define desktop action exceptions
|
||||
|
||||
DEFINE_EXCEPTION(Alfresco, DesktopActionException);
|
||||
|
||||
/**
|
||||
* Desktop Target Class
|
||||
*
|
||||
* Contains the details of a target for a desktop action.
|
||||
*/
|
||||
class Alfresco::DesktopTarget {
|
||||
public:
|
||||
// Class constructors
|
||||
|
||||
DesktopTarget(int typ, String& path);
|
||||
|
||||
// Class destructor
|
||||
|
||||
~DesktopTarget();
|
||||
|
||||
// Return the target type, target path/id
|
||||
|
||||
inline unsigned int isType(void) const { return m_type; }
|
||||
inline const String& getTarget(void) const { return m_target; }
|
||||
|
||||
// Return the target type as a string
|
||||
|
||||
const String getTypeAsString( void) const;
|
||||
|
||||
// Return the target details as a string
|
||||
|
||||
const String toString( void) const;
|
||||
|
||||
// Operators
|
||||
|
||||
bool operator==( const DesktopTarget& target);
|
||||
bool operator<( const DesktopTarget& target);
|
||||
|
||||
private:
|
||||
// Hide the copy constructor
|
||||
|
||||
DesktopTarget(const DesktopTarget& target) {};
|
||||
|
||||
private:
|
||||
// Instance variables
|
||||
//
|
||||
// Target type and path/id
|
||||
|
||||
unsigned int m_type;
|
||||
String m_target;
|
||||
};
|
||||
|
||||
/**
|
||||
* Desktop Params Class
|
||||
*
|
||||
* Contains the parameters for a desktop action request.
|
||||
*/
|
||||
class Alfresco::DesktopParams {
|
||||
public:
|
||||
// Class constructors
|
||||
|
||||
DesktopParams(void) {}
|
||||
|
||||
// Return the number of targets
|
||||
|
||||
inline size_t numberOfTargets(void) const { return m_list.size(); }
|
||||
|
||||
// Return a target from the list
|
||||
|
||||
const DesktopTarget* getTarget(const unsigned int idx) const;
|
||||
|
||||
// Add a desktop target
|
||||
|
||||
inline void addTarget(DesktopTarget* pTarget) { m_list.push_back(pTarget); }
|
||||
|
||||
// Clear the target list
|
||||
|
||||
inline void clearTargets( void) { m_list.clear(); }
|
||||
|
||||
// Return the desktop parameters as a string
|
||||
|
||||
const String toString(void) const;
|
||||
|
||||
private:
|
||||
// Instance variables
|
||||
//
|
||||
// List of file/folder/node targets for the action
|
||||
|
||||
std::vector<DesktopTarget*> m_list;
|
||||
};
|
||||
|
||||
/**
|
||||
* Desktop Response Class
|
||||
*
|
||||
* Contains the result of calling a server side desktop action.
|
||||
*/
|
||||
class Alfresco::DesktopResponse {
|
||||
public:
|
||||
// class constructors
|
||||
|
||||
DesktopResponse( const unsigned int sts, const wchar_t* msg = NULL);
|
||||
|
||||
// Return the status code
|
||||
|
||||
inline unsigned int getStatus( void) const { return m_status; }
|
||||
|
||||
// Check if there is a status message, return the status message
|
||||
|
||||
inline bool hasStatusMessage(void) const { return m_statusMsg.length() > 0; }
|
||||
inline const String& getStatusMessage(void) const { return m_statusMsg; }
|
||||
|
||||
// Assignment operator
|
||||
|
||||
DesktopResponse& operator=( const DesktopResponse& response);
|
||||
|
||||
private:
|
||||
// Instance variables
|
||||
//
|
||||
// Status code and message
|
||||
|
||||
unsigned int m_status;
|
||||
String m_statusMsg;
|
||||
};
|
||||
|
||||
#endif
|
104
repository/src/main/cpp/CAlfrescoApp/includes/util/ByteArray.h
Normal file
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _ByteArray_H
|
||||
#define _ByteArray_H
|
||||
|
||||
// Includes
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "util\Types.h"
|
||||
|
||||
// Classes defined in this header file
|
||||
|
||||
namespace Alfresco {
|
||||
class ByteArray;
|
||||
|
||||
typedef std::auto_ptr<ByteArray> PTR_ByteArray;
|
||||
}
|
||||
|
||||
/**
|
||||
* Byte Array Class
|
||||
*
|
||||
* Provides a byte array object similar to Javas byte[].
|
||||
*/
|
||||
class Alfresco::ByteArray {
|
||||
public:
|
||||
// Constructors
|
||||
|
||||
ByteArray( BUFLEN len = 0, bool clearMem = false);
|
||||
ByteArray( CBUFPTR data, BUFLEN len);
|
||||
ByteArray( const char* data, BUFLEN len);
|
||||
|
||||
// Copy constructor
|
||||
|
||||
ByteArray( const ByteArray& byts);
|
||||
|
||||
// Class destructor
|
||||
|
||||
~ByteArray();
|
||||
|
||||
// Return the data/length
|
||||
|
||||
inline CBUFPTR getData( void) const { return m_data; }
|
||||
inline BUFPTR getData( void) { return m_data; }
|
||||
inline BUFLEN getLength( void) const { return m_length; }
|
||||
|
||||
// Set the array length
|
||||
|
||||
void setLength( BUFLEN len, bool clearMem = false);
|
||||
|
||||
// Set a byte
|
||||
|
||||
void setByte( unsigned int idx, unsigned char val);
|
||||
|
||||
// Subscript operator
|
||||
|
||||
unsigned char& operator[](const unsigned int idx);
|
||||
|
||||
// Assignment operator
|
||||
|
||||
ByteArray& operator=( const ByteArray& byts);
|
||||
ByteArray& operator=( std::string& byts);
|
||||
|
||||
// Equality operator
|
||||
|
||||
bool operator== ( const ByteArray& byts);
|
||||
|
||||
// Return the start address of the byte array
|
||||
|
||||
operator const unsigned char* ( void) { return m_data; }
|
||||
|
||||
protected:
|
||||
// Set the byte array and length
|
||||
|
||||
void setData( CBUFPTR data, BUFLEN len);
|
||||
|
||||
private:
|
||||
// Instance variables
|
||||
//
|
||||
// Byte data and length
|
||||
|
||||
BUFPTR m_data;
|
||||
BUFLEN m_length;
|
||||
};
|
||||
|
||||
#endif
|
152
repository/src/main/cpp/CAlfrescoApp/includes/util/DataBuffer.h
Normal file
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _DataBuffer_H
|
||||
#define _DataBuffer_H
|
||||
|
||||
// Includes
|
||||
|
||||
#include "util\DataPacker.h"
|
||||
|
||||
// Classes defined in this header file
|
||||
|
||||
namespace Alfresco {
|
||||
class DataBuffer;
|
||||
typedef std::auto_ptr<DataBuffer> PTR_DataBuffer;
|
||||
}
|
||||
|
||||
// Constants
|
||||
|
||||
namespace Alfresco {
|
||||
|
||||
// Default data buffer size
|
||||
|
||||
#define DataBufferDefaultSize 256
|
||||
}
|
||||
|
||||
/**
|
||||
* Data Buffer Class
|
||||
*
|
||||
* Dynamic buffer for getting/setting data blocks.
|
||||
*/
|
||||
class Alfresco::DataBuffer {
|
||||
public:
|
||||
// Class constructors
|
||||
|
||||
DataBuffer( unsigned int siz = DataBufferDefaultSize);
|
||||
DataBuffer( BUFPTR buf, BUFPOS off, BUFLEN len);
|
||||
|
||||
// Class destructor
|
||||
|
||||
~DataBuffer();
|
||||
|
||||
// Getter methods
|
||||
|
||||
inline BUFPTR getBuffer( void) { return m_buf; }
|
||||
|
||||
BUFLEN getLength( void) const;
|
||||
unsigned int getLengthInWords( void) const;
|
||||
BUFLEN getAvailableLength( void) const;
|
||||
inline BUFLEN getBufferLength(void) const { return m_buflen; }
|
||||
|
||||
inline unsigned int getDisplacement( void) const { return m_pos - m_offset; }
|
||||
inline BUFPOS getOffset( void) { return m_offset; }
|
||||
inline BUFPOS getPosition( void) { return m_pos; }
|
||||
|
||||
// Get data items from the buffer
|
||||
|
||||
unsigned char getByte( void);
|
||||
unsigned int getShort( void);
|
||||
unsigned int getInt( void);
|
||||
LONG64 getLong( void);
|
||||
String getString( bool uni = true);
|
||||
String getString( unsigned int maxLen, bool uni = true);
|
||||
|
||||
unsigned int getShortAt( unsigned int idx);
|
||||
unsigned int getIntAt( unsigned int idx);
|
||||
LONG64 getLongAt( unsigned int idx);
|
||||
|
||||
// Put data items into the buffer
|
||||
|
||||
void putByte( unsigned char byt);
|
||||
void putShort( unsigned int sval);
|
||||
void putInt( unsigned int ival);
|
||||
void putLong( LONG64 lval);
|
||||
|
||||
void putShortAt( unsigned int idx, unsigned int sval);
|
||||
void putIntAt( unsigned int idx, unsigned int ival);
|
||||
void putLongAt( unsigned int idx, LONG64 lval);
|
||||
|
||||
void putString( const String& str, bool uni = true, bool nulTerm = true);
|
||||
void putFixedString( const String& str, unsigned int len);
|
||||
BUFPOS putStringAt( const String& str, BUFPOS pos, bool uni = true, bool nulTerm = true);
|
||||
BUFPOS putFixedStringAt( const String& str, unsigned int len, BUFPOS pos);
|
||||
|
||||
void putStringPointer( unsigned int off);
|
||||
void putZeros( unsigned int cnt);
|
||||
|
||||
// Align the buffer position
|
||||
|
||||
void wordAlign( void);
|
||||
void longwordAlign( void);
|
||||
|
||||
// Append a raw data block to the buffer
|
||||
|
||||
void appendData( BUFPTR buf, BUFPOS off, BUFLEN len);
|
||||
|
||||
// Copy the data to the user buffer and update the read position
|
||||
|
||||
unsigned int copyData( BUFPTR buf, BUFPOS pos, unsigned int cnt);
|
||||
|
||||
// Skip data items in the buffer
|
||||
|
||||
void skipBytes( unsigned int len);
|
||||
|
||||
// Setter methods
|
||||
|
||||
inline void setPosition( BUFPOS pos) { m_pos = pos; }
|
||||
void setEndOfBuffer( void);
|
||||
void setLength( BUFLEN len);
|
||||
|
||||
private:
|
||||
// Extend the buffer
|
||||
|
||||
void extendBuffer( BUFLEN ext);
|
||||
void extendBuffer( void);
|
||||
|
||||
protected:
|
||||
// Instance variables
|
||||
//
|
||||
// Data buffer
|
||||
|
||||
BUFPTR m_buf;
|
||||
unsigned int m_buflen;
|
||||
|
||||
// Flag to indicate if the buffer is owned by this object
|
||||
|
||||
bool m_owner;
|
||||
|
||||
// Buffer positions/offsets
|
||||
|
||||
BUFPOS m_pos;
|
||||
BUFPOS m_endpos;
|
||||
BUFPOS m_offset;
|
||||
};
|
||||
|
||||
#endif
|
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _DataPacker_H
|
||||
#define _DataPacker_H
|
||||
|
||||
// Includes
|
||||
|
||||
#include "util\String.h"
|
||||
#include "util\Types.h"
|
||||
#include "util\JavaTypes.h"
|
||||
|
||||
// Classes defined in this header file
|
||||
|
||||
namespace Alfresco {
|
||||
class DataPacker;
|
||||
}
|
||||
|
||||
/**
|
||||
* DataPacker Class
|
||||
*
|
||||
* The DataPacker class provides methods for packing and unpacking of various data types from a buffer.
|
||||
*/
|
||||
class Alfresco::DataPacker {
|
||||
private:
|
||||
// Hide constructors
|
||||
|
||||
DataPacker( void) {};
|
||||
DataPacker(const DataPacker& dp) {};
|
||||
|
||||
public:
|
||||
// Unpack data types from a buffer
|
||||
|
||||
static int getShort(CBUFPTR buf, BUFPOS pos);
|
||||
static int getInt(CBUFPTR buf, BUFPOS pos);
|
||||
static LONG64 getLong(CBUFPTR buf, BUFPOS pos);
|
||||
|
||||
static int getIntelShort(CBUFPTR buf, BUFPOS pos);
|
||||
static int getIntelInt(CBUFPTR buf, BUFPOS pos);
|
||||
static LONG64 getIntelLong(CBUFPTR buf, BUFPOS pos);
|
||||
|
||||
static String getString(CBUFPTR buf, BUFPOS pos, const unsigned int maxLen, const bool isUni = false);
|
||||
static String getUnicodeString(CBUFPTR buf, BUFPOS pos, const unsigned int maxLen);
|
||||
|
||||
// Pack data types into a buffer
|
||||
|
||||
static void putShort(const int val, BUFPTR buf, BUFPOS pos);
|
||||
static void putInt(const int val, BUFPTR buf, BUFPOS pos);
|
||||
static void putLong(const LONG64 val, BUFPTR buf, BUFPOS pos);
|
||||
|
||||
static void putIntelShort(const int val, BUFPTR buf, BUFPOS pos);
|
||||
static void putIntelInt(const int val, BUFPTR buf, BUFPOS pos);
|
||||
static void putIntelLong(const LONG64 val, BUFPTR buf, BUFPOS pos);
|
||||
|
||||
static unsigned int putString(const String& str, BUFPTR buf, BUFPOS pos, bool nullTerm = true, bool isUni = false);
|
||||
static unsigned int putString(const char* str, BUFLEN len, BUFPTR buf, BUFPOS pos, bool nullTerm = true);
|
||||
static unsigned int putString(const wchar_t* str, BUFLEN len, BUFPTR buf, BUFPOS pos, bool nullTerm = true);
|
||||
|
||||
static void putZeros(BUFPTR buf, BUFPOS pos, const unsigned int count);
|
||||
|
||||
// Calculate buffer positions
|
||||
|
||||
static unsigned int getStringLength(const String& str, const bool isUni = false, const bool nulTerm = false);
|
||||
static unsigned int getBufferPosition(BUFPOS pos, const String& str, const bool isUni = false, const bool nulTerm = false);
|
||||
|
||||
// Align a buffer offset
|
||||
|
||||
static inline BUFPOS longwordAlign( BUFPOS pos) { return ( pos + 3) & 0xFFFFFFFC; }
|
||||
static inline BUFPOS wordAlign( BUFPOS pos) { return ( pos + 1) & 0xFFFFFFFE; }
|
||||
};
|
||||
|
||||
#endif
|
76
repository/src/main/cpp/CAlfrescoApp/includes/util/Debug.h
Executable file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _Debug_H
|
||||
#define _Debug_H
|
||||
|
||||
// Includes
|
||||
|
||||
#include "util\String.h"
|
||||
#include <ostream>
|
||||
#include <fstream>
|
||||
|
||||
// Classes defined in this header file
|
||||
|
||||
namespace Alfresco {
|
||||
class Debug;
|
||||
|
||||
// Macro to access to the debug output stream
|
||||
|
||||
#define HAS_DEBUG Debug::hasOutputStream() == true
|
||||
#define DBGOUT if ( Debug::hasOutputStream()) Debug::getOutputStream()
|
||||
#define TIMESTAMP Debug::timeStamp();
|
||||
#define DBGOUT_TS TIMESTAMP DBGOUT
|
||||
}
|
||||
|
||||
/**
|
||||
* Debug Logging Class
|
||||
*
|
||||
* Outputs debugging information to a file on the local filesystem.
|
||||
*/
|
||||
class Alfresco::Debug {
|
||||
public:
|
||||
|
||||
// Open/close the debug log
|
||||
|
||||
static void openLog( const char* logName, bool append = true);
|
||||
static void closeLog( void);
|
||||
|
||||
// Check if the output stream is valid, return the output stream
|
||||
|
||||
static bool hasOutputStream( void) { return _debugOut.is_open() ? true : false; }
|
||||
static std::ofstream& getOutputStream( void) { return _debugOut; }
|
||||
|
||||
// Output a timestamp to the debug log
|
||||
|
||||
static void timeStamp( void);
|
||||
|
||||
private:
|
||||
// Debug output log file
|
||||
|
||||
static std::ofstream _debugOut;
|
||||
|
||||
private:
|
||||
// Hide constructors, static only class
|
||||
|
||||
Debug( void) {};
|
||||
Debug( const Debug& dbg) {};
|
||||
};
|
||||
|
||||
#endif
|
125
repository/src/main/cpp/CAlfrescoApp/includes/util/Exception.h
Normal file
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _JavaException_H
|
||||
#define _JavaException_H
|
||||
|
||||
// Includes
|
||||
|
||||
#include "util\String.h"
|
||||
|
||||
// Classes defined in this header file
|
||||
|
||||
namespace Alfresco {
|
||||
class Exception;
|
||||
class IOException;
|
||||
}
|
||||
|
||||
// Macro to check for null and throw a null pointer exception
|
||||
|
||||
#define NULL_POINTER_CHECK(p,m) if(p==NULL) throw NullPointerException(m)
|
||||
|
||||
/**
|
||||
* Java-like Exception Class
|
||||
*
|
||||
* Used as a base class for all Java-like exception classes.
|
||||
*/
|
||||
class Alfresco::Exception {
|
||||
public:
|
||||
// Constructors
|
||||
|
||||
Exception( const wchar_t* msg = NULL, const wchar_t* msg2 = NULL, const wchar_t* msg3 = NULL, const wchar_t* msg4 = NULL, const wchar_t* msg5 = NULL);
|
||||
Exception( const char* moduleName, unsigned int lineNum, const wchar_t* msg = NULL, const wchar_t* msg2 = NULL, const wchar_t* msg3 = NULL, const wchar_t* msg4 = NULL, const wchar_t* msg5 = NULL);
|
||||
|
||||
// Copy constructor
|
||||
|
||||
Exception( const Exception& ex);
|
||||
|
||||
// Class destructor
|
||||
|
||||
~Exception();
|
||||
|
||||
// Return the exception message
|
||||
|
||||
inline const String& getMessage( void) const { return m_msg; }
|
||||
|
||||
// Return the exception as a string
|
||||
|
||||
inline const String& toString( void) const { return m_msg; }
|
||||
|
||||
private:
|
||||
// Instance variables
|
||||
//
|
||||
// Exception message
|
||||
|
||||
String m_msg;
|
||||
};
|
||||
|
||||
// Macros to declare an exception class
|
||||
|
||||
#define DEFINE_EXCEPTION(ns,ex) namespace ns { class ex : public Exception { \
|
||||
public: \
|
||||
ex( const char* modName, unsigned int lineNum, const wchar_t* msg = NULL, const wchar_t* msg2 = NULL, const wchar_t* msg3 = NULL, const wchar_t* msg4 = NULL, const wchar_t* msg5 = NULL); \
|
||||
ex( const wchar_t* msg = NULL, const wchar_t* msg2 = NULL, const wchar_t* msg3 = NULL, const wchar_t* msg4 = NULL, const wchar_t* msg5 = NULL); }; }
|
||||
|
||||
#define DEFINE_IOEXCEPTION(ns,ex) namespace ns { class ex : public IOException { \
|
||||
public: \
|
||||
ex( const char* modName, unsigned int lineNum, const wchar_t* msg = NULL, const wchar_t* msg2 = NULL, const wchar_t* msg3 = NULL, const wchar_t* msg4 = NULL, const wchar_t* msg5 = NULL); \
|
||||
ex( const wchar_t* msg = NULL, const wchar_t* msg2 = NULL, const wchar_t* msg3 = NULL, const wchar_t* msg4 = NULL, const wchar_t* msg5 = NULL); }; }
|
||||
|
||||
// Macros to define new exception class code, should be used in a module not a header
|
||||
|
||||
#define EXCEPTION_CLASS(ns,ex) \
|
||||
ex :: ex( const char* modName, unsigned int lineNum, const wchar_t* msg, const wchar_t* msg2, const wchar_t* msg3, const wchar_t* msg4, const wchar_t* msg5) : \
|
||||
Exception(modName,lineNum,msg,msg2,msg3,msg4,msg5) {} \
|
||||
ex :: ex( const wchar_t* msg, const wchar_t* msg2, const wchar_t* msg3, const wchar_t* msg4, const wchar_t* msg5) : \
|
||||
Exception(msg,msg2,msg3,msg4,msg5) {}
|
||||
|
||||
// Define the IOException class
|
||||
|
||||
DEFINE_EXCEPTION(Alfresco,IOException);
|
||||
|
||||
// Define the macro create new IOException based exceptions
|
||||
|
||||
#define IOEXCEPTION_CLASS(ns,ex) \
|
||||
ex :: ex( const char* modName, unsigned int lineNum, const wchar_t* msg, const wchar_t* msg2, const wchar_t* msg3, const wchar_t* msg4, const wchar_t* msg5) : \
|
||||
IOException(modName,lineNum,msg,msg2,msg3,msg4,msg5) {} \
|
||||
ex :: ex( const wchar_t* msg, const wchar_t* msg2, const wchar_t* msg3, const wchar_t* msg4, const wchar_t* msg5) : \
|
||||
IOException(msg,msg2,msg3,msg4,msg5) {}
|
||||
|
||||
// Define standard exceptions
|
||||
|
||||
DEFINE_EXCEPTION(Alfresco,NullPointerException);
|
||||
DEFINE_EXCEPTION(Alfresco,ArrayIndexOutOfBoundsException);
|
||||
DEFINE_EXCEPTION(Alfresco,NumberFormatException);
|
||||
|
||||
DEFINE_IOEXCEPTION(Alfresco, AccessDeniedException);
|
||||
DEFINE_IOEXCEPTION(Alfresco, DirectoryNotEmptyException);
|
||||
DEFINE_IOEXCEPTION(Alfresco, DiskFullException);
|
||||
DEFINE_IOEXCEPTION(Alfresco, FileExistsException);
|
||||
DEFINE_IOEXCEPTION(Alfresco, FileOfflineException);
|
||||
DEFINE_IOEXCEPTION(Alfresco, FileSharingException);
|
||||
DEFINE_IOEXCEPTION(Alfresco, FileNotFoundException);
|
||||
DEFINE_IOEXCEPTION(Alfresco, PathNotFoundException);
|
||||
DEFINE_IOEXCEPTION(Alfresco, FileLockException);
|
||||
DEFINE_IOEXCEPTION(Alfresco, FileUnlockException);
|
||||
DEFINE_IOEXCEPTION(Alfresco, LockConflictException);
|
||||
DEFINE_IOEXCEPTION(Alfresco, NotLockedException);
|
||||
|
||||
#endif
|
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _FileName_H
|
||||
#define _FileName_H
|
||||
|
||||
// Includes
|
||||
|
||||
#include "util\String.h"
|
||||
|
||||
// Classes defined in this header file
|
||||
|
||||
namespace Alfresco {
|
||||
class FileName;
|
||||
}
|
||||
|
||||
/**
|
||||
* File Naming Utility Class
|
||||
*
|
||||
* Contains various utility methods for building and splitting file paths.
|
||||
*/
|
||||
class Alfresco::FileName {
|
||||
public:
|
||||
// Build a path using the specified components
|
||||
|
||||
static const String buildPath( const String& dev, const String& path, const String& fileName, wchar_t sep = L'\\');
|
||||
|
||||
// Check if a file name contains a stream name
|
||||
|
||||
static bool containsStreamName( const String& fileName);
|
||||
|
||||
// Convert path separator characters
|
||||
|
||||
static const String convertSeperators( const String& path, wchar_t sep);
|
||||
|
||||
// Make a relative path
|
||||
|
||||
static const String makeRelativePath( const String& basePath, const String& fullPath);
|
||||
|
||||
// Map an input path to a real path
|
||||
|
||||
static const String mapPath(const String& base, const String& path);
|
||||
|
||||
// Normalize a path converting all directories to uppercase and keeping the file name as is
|
||||
|
||||
static const String normalizePath(const String& path);
|
||||
|
||||
// Remove the file name from the path
|
||||
|
||||
static const String removeFileName(const String& path);
|
||||
|
||||
// Split the path into all the component directories and filename
|
||||
|
||||
static StringList splitAllPaths(const String& path);
|
||||
|
||||
// Split the path into separate directory path and file name strings
|
||||
|
||||
static StringList splitPath( const String& path, wchar_t sep = L'\\');
|
||||
|
||||
// Split a path string into directory path, file name and stream name components
|
||||
|
||||
static StringList splitPathStream( const String& path);
|
||||
|
||||
public:
|
||||
// Constant values
|
||||
|
||||
static String& DosSeperator;
|
||||
static String& NTFSStreamSeperator;
|
||||
|
||||
static wchar_t DOS_SEPERATOR;
|
||||
|
||||
private:
|
||||
// Hide constructors, static only class
|
||||
|
||||
FileName( void) {};
|
||||
FileName( const FileName& fname) {};
|
||||
};
|
||||
|
||||
#endif
|
62
repository/src/main/cpp/CAlfrescoApp/includes/util/Integer.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _JavaInteger_H
|
||||
#define _JavaInteger_H
|
||||
|
||||
// Includes
|
||||
|
||||
#include "util\String.h"
|
||||
#include "util\Exception.h"
|
||||
#include "util\Types.h"
|
||||
|
||||
// Classes defined in this header file
|
||||
|
||||
namespace Alfresco {
|
||||
class Integer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Java-like Integer Class
|
||||
*
|
||||
* Provides static methods to convert integer values to strings.
|
||||
*/
|
||||
class Alfresco::Integer {
|
||||
public:
|
||||
// Convert an integer to a hexadecimal string
|
||||
|
||||
static String toHexString( const unsigned int ival);
|
||||
static String toHexString( BUFPTR ptr);
|
||||
|
||||
// Convert an integer value to a string
|
||||
|
||||
static String toString( unsigned int ival, unsigned int radix = 10);
|
||||
|
||||
// Parse a string to generate an integer value
|
||||
|
||||
static unsigned int parseInt( const String& str, unsigned int radix = 10);
|
||||
|
||||
private:
|
||||
// Hide constructors, static only class
|
||||
|
||||
Integer( void);
|
||||
Integer(Integer& ival);
|
||||
};
|
||||
|
||||
#endif
|
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _JavaTypes_H
|
||||
#define _JavaTypes_H
|
||||
|
||||
// Typedefs for Java primitive types
|
||||
|
||||
typedef __int64 LONG64;
|
||||
|
||||
#endif
|
79
repository/src/main/cpp/CAlfrescoApp/includes/util/Long.h
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _JavaLong_H
|
||||
#define _JavaLong_H
|
||||
|
||||
// Includes
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "util\String.h"
|
||||
#include "util\Exception.h"
|
||||
#include "util\JavaTypes.h"
|
||||
|
||||
// Classes defined in this header file
|
||||
|
||||
namespace Alfresco {
|
||||
class Long;
|
||||
}
|
||||
|
||||
/**
|
||||
* Java-like Long Class
|
||||
*
|
||||
* Provides static methods to convert long/64 bit values to strings.
|
||||
*/
|
||||
class Alfresco::Long {
|
||||
public:
|
||||
// Convert a long/64 bit integer to a hexadecimal string
|
||||
|
||||
static String toHexString( const LONG64 lval);
|
||||
|
||||
// Convert a long/64 bit integer to a decimal string
|
||||
|
||||
static String toString( const LONG64 lval);
|
||||
|
||||
// Make a long/64bit value from the low/high 32bit values
|
||||
|
||||
static LONG64 makeLong( unsigned int lowPart, unsigned int highPart);
|
||||
static LONG64 makeLong( FILETIME fTime);
|
||||
|
||||
// Get the low/high 32bit values from a 64bit value
|
||||
|
||||
static bool hasHighPart( LONG64 lval) { return ( lval > 0xFFFFFFFF) ? true : false; }
|
||||
|
||||
static unsigned int getLowPart( LONG64 lval) { return (unsigned int) lval & 0xFFFFFFFF; }
|
||||
static unsigned int getHighPart( LONG64 lval) { return (unsigned int) ((lval >> 32) & 0xFFFFFFFF); }
|
||||
|
||||
// Parse a string to generate a long/64 bit integer value
|
||||
|
||||
static LONG64 parseLong( const String& str, unsigned int radix = 10);
|
||||
|
||||
// Copy a long/64bit value to a FILETIME structure
|
||||
|
||||
static void copyTo( LONG64 lval, FILETIME& ftime);
|
||||
|
||||
private:
|
||||
// Hide constructors, static only class
|
||||
|
||||
Long( void);
|
||||
Long(Long& ival);
|
||||
};
|
||||
|
||||
#endif
|
263
repository/src/main/cpp/CAlfrescoApp/includes/util/String.h
Normal file
@@ -0,0 +1,263 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _JavaString_H
|
||||
#define _JavaString_H
|
||||
|
||||
// Includes
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
|
||||
#include "util\ByteArray.h"
|
||||
#include "util\Types.h"
|
||||
|
||||
// Classes defined in this header file
|
||||
|
||||
namespace Alfresco {
|
||||
class String;
|
||||
class StringList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Java-like String Class
|
||||
*/
|
||||
class Alfresco::String {
|
||||
public:
|
||||
// Constructors
|
||||
|
||||
String();
|
||||
String(const unsigned int alloc);
|
||||
String(const char* str);
|
||||
String(const unsigned char* str);
|
||||
String(const char* buf, const unsigned int offset, const unsigned int len);
|
||||
String(const wchar_t* str);
|
||||
String(const wchar_t* buf, const unsigned int offset, const unsigned int len);
|
||||
String(const String& str);
|
||||
String(const std::wstring& str);
|
||||
String(ByteArray& byts);
|
||||
|
||||
// Return the string length
|
||||
|
||||
inline unsigned int length( void) const { return ( unsigned int) m_string.length(); }
|
||||
|
||||
// Check if a string is empty
|
||||
|
||||
inline bool isNull( void) const { return m_string.length() > 0 ? false : true; }
|
||||
inline bool isNotEmpty( void) const { return m_string.length() > 0 ? true : false; }
|
||||
|
||||
// Compare strings for equality
|
||||
|
||||
bool equals(const wchar_t* str) const;
|
||||
bool equals(const String& str) const;
|
||||
|
||||
bool equalsIgnoreCase(const wchar_t* str) const;
|
||||
bool equalsIgnoreCase(const String& str) const;
|
||||
|
||||
// Compare strings
|
||||
|
||||
int compareTo( const String& str) const;
|
||||
int compareTo( const wchar_t* pStr) const;
|
||||
|
||||
// Convert to lowercase/uppercase returning the new string
|
||||
|
||||
String toLowerCase() const;
|
||||
String toUpperCase() const;
|
||||
|
||||
// Search for the occurrence of a character or string
|
||||
|
||||
int indexOf(const wchar_t ch, int startIndex = 0) const;
|
||||
int indexOf(const wchar_t* str, int startIndex = 0) const;
|
||||
int indexOf(const String& str, int startIndex = 0) const;
|
||||
|
||||
// Search for the occurrence of a character or string
|
||||
|
||||
int lastIndexOf(const wchar_t ch, int startIndex = -1) const;
|
||||
int lastIndexOf(const wchar_t* str, int startIndex = -1) const;
|
||||
int lastIndexOf(const String& str, int startIndex = -1) const;
|
||||
|
||||
// Check if the string starts with the specified string
|
||||
|
||||
bool startsWith(const wchar_t* str) const;
|
||||
bool startsWith(const String& str) const;
|
||||
|
||||
bool startsWithIgnoreCase(const wchar_t* str) const;
|
||||
bool startsWithIgnoreCase(const String& str) const;
|
||||
|
||||
// Check if the string ends with the specified string
|
||||
|
||||
bool endsWith(const wchar_t* str) const;
|
||||
bool endsWith(const String& str) const;
|
||||
|
||||
// Replace all occurrences of the specified character in the string
|
||||
|
||||
void replace( wchar_t oldCh, wchar_t newCh);
|
||||
|
||||
// Append character, string, integer values to the string
|
||||
|
||||
void append( wchar_t ch);
|
||||
void append( const char* str);
|
||||
void append( const wchar_t* str);
|
||||
void append( const String& str);
|
||||
void append( const unsigned int ival);
|
||||
void append( const unsigned long lval);
|
||||
void append( const LONG64 l64val);
|
||||
|
||||
// Get the character at the specified position in the string
|
||||
|
||||
inline wchar_t charAt(const unsigned int idx) const { return m_string[idx]; }
|
||||
|
||||
// Set the string length
|
||||
|
||||
inline void setLength( unsigned int len) { m_string.resize( len, 0); }
|
||||
|
||||
// Trim leading and trailing whitespace from the string
|
||||
|
||||
String trim( void) const;
|
||||
|
||||
// Return the substring of this string
|
||||
|
||||
String substring( unsigned int beginIndex) const;
|
||||
String substring( unsigned int beginIndex, unsigned int endIndex) const;
|
||||
|
||||
// Set the allocated capacity for the string by allocating or shrinking the current string buffer
|
||||
|
||||
inline void reserve( const unsigned int capacity = 0) { m_string.reserve( capacity); }
|
||||
|
||||
// Assignment operator
|
||||
|
||||
String& operator=(const wchar_t* str);
|
||||
String& operator=(const String& str);
|
||||
|
||||
// Append operator
|
||||
|
||||
inline String& operator+=(wchar_t ch) { append( ch); return *this; }
|
||||
inline String& operator+=(const char* str) { append( str); return *this; }
|
||||
inline String& operator+=(const wchar_t* str) { append( str); return *this; }
|
||||
inline String& operator+=(const String& str) { append( str); return *this; }
|
||||
inline String& operator+=(const unsigned int ival) { append( ival); return *this; }
|
||||
inline String& operator+=(const unsigned long lval) { append( lval); return *this; }
|
||||
inline String& operator+=(const LONG64 l64val) { append( l64val); return *this; }
|
||||
|
||||
// Equality operator
|
||||
|
||||
bool operator== ( const String& str) const;
|
||||
bool operator== ( const wchar_t* str) const;
|
||||
bool operator== ( const char* str) const;
|
||||
|
||||
// Less than operator
|
||||
|
||||
bool operator< ( const String& str) const;
|
||||
|
||||
// Return the string data
|
||||
|
||||
inline const wchar_t* data() const { return m_string.data(); }
|
||||
|
||||
// Conversion operator
|
||||
|
||||
inline operator const wchar_t* ( void) const { return m_string.data(); }
|
||||
|
||||
// Return the string as an array of bytes
|
||||
|
||||
ByteArray getBytes( ByteArray& byts) const;
|
||||
ByteArray getBytes( void) const;
|
||||
|
||||
// Split the string into tokens using the specified delimiters
|
||||
|
||||
StringList tokenize( const String& delims) const;
|
||||
|
||||
// Streaming operators
|
||||
|
||||
friend std::wostream& operator<<(std::wostream& out, const String& str);
|
||||
friend std::ostream& operator<<(std::ostream& out, const String& str);
|
||||
|
||||
// Access the internal string object
|
||||
|
||||
inline std::wstring getString( void) { return m_string; }
|
||||
inline const std::wstring getString( void) const { return m_string; }
|
||||
|
||||
private:
|
||||
// String data
|
||||
|
||||
std::wstring m_string;
|
||||
};
|
||||
|
||||
/**
|
||||
* String List Class
|
||||
*/
|
||||
class Alfresco::StringList {
|
||||
public:
|
||||
// Class constructor
|
||||
|
||||
StringList( void);
|
||||
StringList( unsigned int reserve);
|
||||
StringList( const StringList& strList);
|
||||
|
||||
// Add a string to the list
|
||||
|
||||
inline void addString( const String& str) { m_list.push_back( str); }
|
||||
|
||||
// Check if the list contains the specified string
|
||||
|
||||
bool containsString( const String& str);
|
||||
bool containsStringCaseless ( const String& str);
|
||||
|
||||
// Return the index of the specified string, or -1 if not found
|
||||
|
||||
int indexOf( const String& str) const;
|
||||
|
||||
// Remove a string from the list
|
||||
|
||||
void removeString( const String& str);
|
||||
void removeStringCaseless( const String& str);
|
||||
|
||||
// Return the number of strings in the list
|
||||
|
||||
inline size_t numberOfStrings( void) const { return m_list.size(); }
|
||||
|
||||
// Return the specified string
|
||||
|
||||
inline const String& getStringAt( unsigned int idx) const { return m_list[idx]; }
|
||||
|
||||
// Assignment operator
|
||||
|
||||
inline String& operator[] ( const unsigned int idx) { return m_list[idx]; }
|
||||
|
||||
// Remove all strings from the list
|
||||
|
||||
inline void removeAllStrings( void) { m_list.clear(); }
|
||||
|
||||
// Copy the string list
|
||||
|
||||
void copyFrom( const StringList& strList);
|
||||
|
||||
// Return the string list as a comma separated list
|
||||
|
||||
String toString( void) const;
|
||||
|
||||
private:
|
||||
// Instance variables
|
||||
//
|
||||
// List of strings
|
||||
|
||||
std::vector<String> m_list;
|
||||
};
|
||||
|
||||
#endif
|
50
repository/src/main/cpp/CAlfrescoApp/includes/util/System.h
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _JavaSystem_H
|
||||
#define _JavaSystem_H
|
||||
|
||||
// Includes
|
||||
|
||||
#include "util\Types.h"
|
||||
|
||||
// Classes defined in this header file
|
||||
|
||||
namespace Alfresco {
|
||||
class System;
|
||||
}
|
||||
|
||||
/**
|
||||
* Java-like System Class
|
||||
*/
|
||||
class Alfresco::System {
|
||||
public:
|
||||
|
||||
// Get the current system time in milliseconds
|
||||
|
||||
static DATETIME currentTimeMillis( void);
|
||||
|
||||
private:
|
||||
// Hide constructors, static only class
|
||||
|
||||
System( void) {};
|
||||
System ( const System& sys) {};
|
||||
};
|
||||
|
||||
#endif
|
52
repository/src/main/cpp/CAlfrescoApp/includes/util/Types.h
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2010 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _AlfrescoTypes_H
|
||||
#define _AlfrescoTypes_H
|
||||
|
||||
// Includes
|
||||
|
||||
#include "util\JavaTypes.h"
|
||||
|
||||
namespace Alfresco {
|
||||
|
||||
// Type definitions
|
||||
//
|
||||
// Data buffer pointer, position and length
|
||||
|
||||
typedef unsigned char* BUFPTR;
|
||||
typedef unsigned int BUFPOS;
|
||||
typedef unsigned int BUFLEN;
|
||||
|
||||
typedef const unsigned char* CBUFPTR;
|
||||
typedef const unsigned int CBUFPOS;
|
||||
typedef const unsigned int CBUFLEN;
|
||||
|
||||
// File position and length
|
||||
|
||||
typedef LONG64 FILEPOS;
|
||||
typedef LONG64 FILELEN;
|
||||
|
||||
// Date/time
|
||||
|
||||
typedef LONG64 DATETIME;
|
||||
#define NULL_DATETIME ((DATETIME) 0)
|
||||
}
|
||||
|
||||
#endif
|
BIN
repository/src/main/cpp/CAlfrescoApp/res/CAlfrescoApp.ico
Normal file
After Width: | Height: | Size: 21 KiB |