├── .gitignore ├── README.md ├── alfresco-demo-data-exporter-repo-amp ├── pom.xml └── src │ ├── main │ ├── amp │ │ ├── config │ │ │ └── alfresco │ │ │ │ ├── extension │ │ │ │ └── templates │ │ │ │ │ └── webscripts │ │ │ │ │ └── org │ │ │ │ │ └── alfresco │ │ │ │ │ └── devops │ │ │ │ │ ├── exporters │ │ │ │ │ ├── categoriesacpexporter.get.desc.xml │ │ │ │ │ ├── filesfolderacpexporter.get.desc.xml │ │ │ │ │ └── peopleusersgroupacpexporter.get.desc.xml │ │ │ │ │ └── smartfolders │ │ │ │ │ ├── enablesf.get.desc.xml │ │ │ │ │ ├── enablesf.get.js │ │ │ │ │ └── enablesf.get.json.ftl │ │ │ │ └── module │ │ │ │ └── alfresco-demo-data-exporter-repo-amp │ │ │ │ ├── alfresco-global.properties │ │ │ │ ├── context │ │ │ │ └── service-context.xml │ │ │ │ ├── log4j.properties │ │ │ │ ├── model │ │ │ │ └── demo-data-exporter-model.xml │ │ │ │ └── module-context.xml │ │ └── module.properties │ └── java │ │ └── org │ │ └── alfresco │ │ ├── devops │ │ ├── exporter │ │ │ └── util │ │ │ │ ├── Constants.java │ │ │ │ └── Utils.java │ │ └── exporters │ │ │ ├── CategoriesAcpExporter.java │ │ │ ├── FileFolderAcpExporter.java │ │ │ └── PeopleUsersGroupAcpExporter.java │ │ └── repo │ │ └── exporter │ │ └── ExporterComponentCustom.java │ └── test │ ├── properties │ └── local │ │ └── alfresco-global.properties │ └── resources │ ├── alfresco │ └── extension │ │ └── disable-webscript-caching-context.xml │ └── test-log4j.properties ├── alfresco-demo-data-repo-amp ├── pom.xml └── src │ ├── main │ ├── amp │ │ ├── config │ │ │ └── alfresco │ │ │ │ ├── messages │ │ │ │ └── boostrap-messages.properties │ │ │ │ └── module │ │ │ │ └── alfresco-demo-data-repo-amp │ │ │ │ ├── alfresco-global.properties │ │ │ │ ├── bootstrap │ │ │ │ └── dynamic │ │ │ │ │ ├── authorities │ │ │ │ │ ├── Groups.json │ │ │ │ │ ├── People.acp │ │ │ │ │ └── Users.acp │ │ │ │ │ ├── models │ │ │ │ │ └── xml │ │ │ │ │ │ └── marketingModel.xml │ │ │ │ │ ├── repo │ │ │ │ │ └── app:company_home │ │ │ │ │ │ ├── app:dictionary │ │ │ │ │ │ ├── Solr-Facets-Space.acp │ │ │ │ │ │ ├── app:models │ │ │ │ │ │ │ └── Models.acp │ │ │ │ │ │ ├── app:scripts │ │ │ │ │ │ │ ├── custom-scripts.acp │ │ │ │ │ │ │ └── vf-custom-scripts.acp │ │ │ │ │ │ └── app:smart_folders │ │ │ │ │ │ │ └── Smart_Folder_Templates.acp │ │ │ │ │ │ └── st:sites │ │ │ │ │ │ └── cm:surf-config │ │ │ │ │ │ ├── cm:extensions │ │ │ │ │ │ └── extensions.acp │ │ │ │ │ │ └── cm:module-deployments │ │ │ │ │ │ └── module-deployments.acp │ │ │ │ │ ├── sites │ │ │ │ │ ├── accounting │ │ │ │ │ │ └── Contents.acp │ │ │ │ │ ├── engineering-projects │ │ │ │ │ │ └── Contents.acp │ │ │ │ │ ├── executive-team │ │ │ │ │ │ └── Contents.acp │ │ │ │ │ ├── hr-team │ │ │ │ │ │ └── Contents.acp │ │ │ │ │ ├── marketing-site │ │ │ │ │ │ └── Contents.acp │ │ │ │ │ ├── rm │ │ │ │ │ │ └── Contents.acp │ │ │ │ │ ├── sales-enablement │ │ │ │ │ │ └── Contents.acp │ │ │ │ │ ├── smart-folders │ │ │ │ │ │ └── Contents.acp │ │ │ │ │ ├── social-media │ │ │ │ │ │ └── Contents.acp │ │ │ │ │ └── support-case-files │ │ │ │ │ │ └── Contents.acp │ │ │ │ │ └── workflows │ │ │ │ │ ├── labels │ │ │ │ │ ├── scWorkflow.properties │ │ │ │ │ └── scWorkflow_en.properties │ │ │ │ │ ├── models │ │ │ │ │ └── scWorkflowModel.xml │ │ │ │ │ └── workflowDefinitions │ │ │ │ │ ├── helloWorld.bpmn │ │ │ │ │ ├── helloWorldFork.bpmn │ │ │ │ │ ├── helloWorldUI.bpmn │ │ │ │ │ └── publishWhitepaper.bpmn │ │ │ │ ├── context │ │ │ │ ├── dynamic-bootstrap-context.xml │ │ │ │ ├── service-context.xml │ │ │ │ └── std-bootstrap-context.xml │ │ │ │ ├── log4j.properties │ │ │ │ └── module-context.xml │ │ └── module.properties │ └── java │ │ └── org │ │ └── alfresco │ │ └── devops │ │ ├── importers │ │ ├── GroupsImporterPatch.java │ │ ├── PostSiteLoadPatch.java │ │ ├── RMSitePatch.java │ │ └── UsersImporterPatch.java │ │ ├── services │ │ ├── DynamicBootstrapPatchPostProcessor.java │ │ └── ResourcesResolver.java │ │ └── util │ │ └── Constants.java │ └── test │ ├── properties │ └── local │ │ └── alfresco-global.properties │ └── resources │ ├── alfresco │ └── extension │ │ └── disable-webscript-caching-context.xml │ └── test-log4j.properties ├── alfresco-demo-data-share-amp ├── pom.xml └── src │ └── main │ ├── amp │ ├── config │ │ └── alfresco │ │ │ └── web-extension │ │ │ ├── custom-slingshot-application-context.xml │ │ │ └── messages │ │ │ └── marketingmodel.properties │ ├── file-mapping.properties │ └── module.properties │ └── resources │ └── META-INF │ └── share-config-custom.xml ├── clean-data.sh ├── pom.xml ├── repo ├── pom.xml └── src │ └── main │ ├── properties │ └── local │ │ └── alfresco-global.properties │ └── resources │ └── alfresco │ └── extension │ └── dev-log4j.properties ├── run-debug.sh ├── run.bat ├── run.sh ├── runner ├── pom.xml ├── src │ └── main │ │ └── webapp │ │ └── index.html ├── test-ng │ └── testng-alfresco-share.xml └── tomcat │ ├── context-repo.xml │ ├── context-share.xml │ └── context-solr.xml ├── share ├── pom.xml └── src │ ├── main │ └── resources │ │ ├── alfresco │ │ └── web-extension │ │ │ ├── custom-slingshot-application-context.xml.sample │ │ │ └── share-config-custom.xml │ │ └── log4j.properties │ └── test │ └── resources │ ├── alfresco │ └── web-extension │ │ └── share-config-custom.xml │ └── log4j.properties └── solr-config └── pom.xml /.gitignore: -------------------------------------------------------------------------------- 1 | alf_data_dev/ 2 | *.log 3 | target/ 4 | .classpath 5 | .project
 6 | .settings 7 | **.iml 8 | .idea -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Alfresco Demo Data 2 | --- 3 | 4 | This module (Alfresco Repository AMP) loads some sample sites, users and groups into Alfresco at boot time; it can be used for demo purposes, but also for initial Repository configuration. 5 | 6 | The project allows you to run Alfresco locally and create your content; following the steps below you will be able to simply export your data, update the project and (re)generate the AMP with the updated data that needs to be bootstrapped. 7 | 8 | **IMPORTANT: this module MUST be used with an EMPTY repository.** 9 | 10 | The module is composed by two Alfresco repo AMP: 11 | 12 | - **alfresco-demo-data-repo-amp**: (*DEMO DATA BOOTSTRAP*) to import data - install this just where custom data have to be loaded 13 | - **alfresco-demo-data-exporter-repo-amp**: (*EXPORTER*) to export Users/Groups and RM sites - install this just where data have to be exported 14 | 15 | Prerequisites 16 | --- 17 | - [Alfresco Knowledge](http://docs.alfresco.com/5.0/concepts/system-about.html) 18 | - [Alfresco Maven SDK 2.1.1 Knowledge](http://docs.alfresco.com/5.0/concepts/alfresco-sdk-intro.html) 19 | - [JDK 1.8](http://docs.alfresco.com/5.0/tasks/alfresco-sdk-install-java.html) 20 | - [Maven 3.2.5+](http://docs.alfresco.com/5.0/tasks/alfresco-sdk-install-maven.html) 21 | - [Maven Settings](http://docs.alfresco.com/5.0/tasks/alfresco-sdk-install-maven-opts.html) 22 | 23 | 24 | How to run it 25 | --- 26 | 27 | From the project parent folder execute **run.sh** or **run.bat** and it will start an Alfresco Community version on an embedded Tomcat with embedded [H2 Database](http://www.h2database.com/html/main.html) 28 | 29 | What is already inside 30 | --- 31 | 32 | Once the Alfresco SDK is running is possible to access it through the URL [http://localhost:8080/share](http://localhost:8080/share). 33 | 34 | By default the Alfresco Demo Data will create the following **Share Sites**: 35 | 36 | - `accounting` 37 | - `engineering-projects` 38 | - `executive-team` 39 | - `hr-team` 40 | - `marketing-site` 41 | - `sales-contracts` 42 | - `sales-enablement` 43 | - `social-media` 44 | - `support-case-files` 45 | - `smart-folders` 46 | 47 | 48 | And a number of users and groups listed here: 49 | 50 | - [Users](http://localhost:8080/share/page/console/admin-console/users#state=panel%3Dsearch%26search%3D%255C*) 51 | - [Groups] (http://localhost:8080/share/page/console/admin-console/groups#state=panel%3Dsearch%26refresh%3Dfalse) 52 | 53 | Sites & Authorities Update 54 | --- 55 | 56 | In order to make any change on the importer: 57 | 58 | - Download the project, perform the necessary changes into the **alfresco-demo-data-repo-amp project** and and run ***mvn package*** to create a new AMP 59 | 60 | 61 | Let's have a look on how to do it in more details: 62 | 63 | -- 64 | 65 | ##### Add a new Site 66 | 67 | - It is first necessary to export the site from an existing Alfresco instance using the already existing [site-export Rest API](http://docs.alfresco.com/community/references/RESTful-SiteSite-exportGet.html) with admin user credentials 68 | 69 | ``` 70 | http://localhost:8080/alfresco/s/api/sites/$SITE_NAME/export 71 | ``` 72 | - Unzip the export file 73 | - Create a folder into **demo-data/alfresco-demo-data/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites** with the site name (it has to be the exact same short-name used by the Share url) 74 | - Move the **Contents.acp** into the previously created folder (**other ACPs are NOT needed**) 75 | - No configuration needed 76 | 77 | 78 | 79 | ##### Add Authorities 80 | - It is first necessary to export the authorities from an existing Alfresco instance using a custom Authorities export Rest API (included in this repo-amp) with admin user credentials 81 | 82 | ``` 83 | http://localhost:8080/alfresco/service/api/people-groups/export 84 | ``` 85 | 86 | - Unzip the export file 87 | - Move the **People.acp**,**Users.acp**,**Groups.json** into **demo-data/alfresco-demo-data/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/authorities** 88 | - No configuration needed 89 | 90 | Repo Folders Update 91 | --- 92 | Using the *alfresco-demo-data-exporter-repo-amp* it is possible to export folders inside the **Company Home**. 93 | 94 | The url to export a folder is 95 | 96 | ``` 97 | http://:/alfresco/service/api/file-folder/export?path={path} 98 | ``` 99 | 100 | This will download an ACP with the folder and its content 101 | 102 | The full url of the webscript is: 103 | 104 | ``` 105 | /api/file-folder/export?path={path}&crawlSelf={crawlSelf}&crawlChildNodes={crawlChildNodes}&crawlContent={crawlContent}&crawlAssociations={crawlAssociations} 106 | ``` 107 | 108 | So it is possible to set: 109 | 110 | - **path**: path of the folder/file to export 111 | - **crawlSelf**: (*true/false*) whether to include the element passed in the path or not (*default: true*) 112 | - **crawlChildNodes**: (*true/false*) whether to include child nodes of the element passed in the path or not (*default: true*) 113 | - **crawlContent**: (*true/false*) whether to include contents or not (*default: true*) 114 | - **crawlAssociations**: (*true/false*) whether to include associations or not (*default: true*) 115 | 116 | To import a file or folder is necessary to move the acp into the desired folder of the repo. 117 | Example: to place some javascripts inside the folder Company Home\Data Dictionary\Scripts just place the ACP containing the scripts into the folder of the project **demo-data/alfresco-demo-data/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/repo/app:company_home/app:dictionary/app:scripts**. 118 | 119 | **Note1:** Do **NOT** export/import an already existing file/folder into Alfresco otherwise a conflict error would occur. 120 | 121 | - To export an existing folder content without importing the folder itself use the parameter **crawlSelf=false**. 122 | 123 | Example: **http://localhost:8080/alfresco/service/api/file-folder/export?path=/Data Dictionary/Models&crawlSelf=false** 124 | 125 | This will import the content of the Models folder without the folder itself. 126 | 127 | - Then to import it just place the acp into **demo-data/alfresco-demo-data/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/repo/app:company_home/app:dictionary/app:models** 128 | 129 | **Note2:** Inside the repo folder of the project all the folders MUST have the alfresco name following the NodeBrowser PATH naming. ( e.g. /app:company_home/app:dictionary/app:scripts) 130 | 131 | 132 | Add a new Model dynamically 133 | --- 134 | Just place your xml model definition into 135 | 136 | **demo-data/alfresco-demo-data/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/models/xml** 137 | 138 | and the labels into 139 | 140 | **demo-data/alfresco-demo-data/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/models/labels** 141 | 142 | *No bean configuration is needed!!* 143 | 144 | Add a new Workflow dynamically 145 | --- 146 | Just place your xml workflow definition into 147 | 148 | **demo-data/alfresco-demo-data/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/workflows/workflowDefinitions** 149 | 150 | the models associated into: 151 | 152 | **demo-data/alfresco-demo-data/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/workflows/models** 153 | 154 | and the labels into 155 | 156 | **demo-data/alfresco-demo-data/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/workflows/labels** 157 | 158 | *No bean configuration is needed!!* 159 | 160 | Release 161 | --- 162 | The release process will create the AMP artifact and upload it to Alfresco Internal Nexus; you can change `pom.xml` settings to use your own Maven Repository. 163 | 164 | Maven is configured to only deploy the AMP artifact, saving time and bandwidth. 165 | 166 | ``` 167 | mvn release:prepare release:perform 168 | ``` 169 | 170 | Make sure that the following item is defined in your `~/.m2/settings.xml` 171 | 172 | ``` 173 | 174 | alfresco-internal 175 | ... 176 | ... 177 | 178 | ``` 179 | 180 | Export/Import Examples: 181 | --- 182 | * **Export a site called 'Demo Data Test Site'** 183 | 184 | - Run 185 | 186 | ``` 187 | http://localhost:8080/alfresco/s/api/sites/demo-data-test-site/export 188 | ``` 189 | - Unpackage the zip 190 | - Create a folder called 'demo-data-test-site' into 'bootstrap/dynamic/sites' 191 | - Place the **Contents.acp** into the previously created folder 192 | - Ignore the rest of files into the zip 193 | 194 | * **Export a site with SMART FOLDERS in it called 'Smart Folders'** 195 | 196 | In order to export a site containing smart folders it is necessary to disable this feature. By default Alfresco allows to enable/disable it via alfresco-global.properties, so a restart is needed. The exporter AMP contains a custom api to enable/disable it without server restart 197 | 198 | - Run this to **GLOBALLY disable** the smart folders 199 | 200 | ``` 201 | localhost:8080/alfresco/service/api/smart-folders?enable=false 202 | ``` 203 | 204 | - Follow the commands on the previous paragraph 205 | - Run this to **GLOBALLY enable** the smart folders 206 | 207 | ``` 208 | localhost:8080/alfresco/service/api/smart-folders?enable=true 209 | ``` 210 | * **Export/Import the Smart Folders templates** 211 | 212 | The 'Smart folders template' folder already has a json example in it, so in order to export it, it is necessary to specify the content of the folder to export, separating it via commas, for example: 213 | 214 | ``` 215 | http://localhost:8080/alfresco/service/api/file-folder/export?path=/Data Dictionary/Smart Folder Templates/mysf1.json,/Data Dictionary/Smart Folder Templates/mysf2.json 216 | ``` 217 | 218 | Place the acp into 219 | 220 | ``` 221 | bootstrap/dynamic/repo/app:company_home/app:dictionary/app:smart_folders 222 | ``` 223 | 224 | * **Export/Import the Share Facets** 225 | 226 | Run 227 | 228 | ``` 229 | http://localhost:8080/alfresco/service/api/file-folder/export?path=/Data Dictionary/Solr Facets Space 230 | ``` 231 | 232 | When Alfresco bootstraps the Solr Facet Space is not already created, so the crawlSelf=false should not be called. 233 | 234 | Place the acp into 235 | 236 | ``` 237 | bootstrap/dynamic/repo/app:company_home/app:dictionary 238 | ``` 239 | 240 | * **Export/Import the Scripts** 241 | 242 | Since the Scripts folder contains already some sample js files it would be more convenient to create a new folder inside the Scripts folder and export/import that one 243 | 244 | ``` 245 | http://localhost:8080/alfresco/service/api/file-folder/export?path=/Data Dictionary/Scripts/custom-scripts 246 | ``` 247 | 248 | and import the script acp into 249 | 250 | ``` 251 | bootstrap/dynamic/repo/app:company_home/app:dictionary/app:scripts 252 | ``` 253 | 254 | Alternatively it is possible to take the same approach taken for Smart Folder Templates 255 | 256 | * **Export ALL the models (even the one created by Share UI in 5.1)** 257 | 258 | Run the following three commands 259 | 260 | ``` 261 | http://localhost:8080/alfresco/service/api/file-folder/export?path=/Data Dictionary/Models&crawlSelf=false 262 | ``` 263 | 264 | ``` 265 | http://localhost:8080/alfresco/service/api/file-folder/export?path=/Sites/surf-config/extensions&crawlSelf=false 266 | ``` 267 | ``` 268 | http://localhost:8080/alfresco/service/api/file-folder/export?path=/Sites/surf-config/module-deployments&crawlSelf=false 269 | ``` 270 | 271 | To import: 272 | 273 | Place *models.acp* inside 274 | 275 | ``` 276 | alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/repo/app:company_home/app:dictionary/app:models 277 | ``` 278 | 279 | Place *extensions.acp* inside 280 | 281 | ``` 282 | alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/repo/app:company_home/st:sites/cm:surf-config/cm:extensions 283 | ``` 284 | 285 | Place *module-deployments.acp* inside 286 | 287 | ``` 288 | alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/repo/app:company_home/st:sites/cm:surf-config/cm:module-deployments 289 | ``` 290 | 291 | Notes 292 | --- 293 | #### Why are both Users.acp and People.acp necessary? 294 | Alfresco uses both cm:person and usr:user objects to store users information, so they are both needed when importing/exporting users info. 295 | 296 | #### How do the importers work? 297 | Users,People and Site contents are imported using the Alfresco [ImporterBootstrap](http://dev.alfresco.com/resource/docs/java/org/alfresco/repo/importer/ImporterBootstrap.html). 298 | This means that it will import the nodes using the exact same nodeRef used in the previous Alfresco instance. 299 | 300 | It is not possible to import Groups at the moment using the ImporterBootstrap, so a new Exporter/Importer logic has been implemented that will export and import new groups, handle the membership and the zones. 301 | 302 | #### How do the dynamic importers work? 303 | They use the [BeanDefinitionRegistryPostProcessor](http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/beans/factory/support/BeanDefinitionRegistryPostProcessor.html) utility to dynamically create Spring bean to load data 304 | 305 | #### Spring Beans Order Matters!!!! 306 | - Authority importers have to be loaded after Site content importer, otherwise the site creation will fail (because the site groups would have been already created). So it is necessary to define the Site importer Spring bean before the authorities one in the context xml file. 307 | - Beans for standard import are automatically loaded before the dynamic ones regardless of the order on the xml context file, no way to change this behaviour at the moment 308 | 309 | #### Export Data 310 | To export authorities the **alfresco-demo-data-export-repo-amp** AMP should be used in your Alfresco instance. 311 | 312 | 313 | #### More about the Authorities Exporter 314 | The url of the webscript is: 315 | 316 | ``` 317 | /api/people-groups/export?usersToExport={usersToExport}&groupsToExport={groupsToExport}&excludeSiteGroups={excludeSiteGroups}&groupsToExclude={groupsToExclude}&usersToExclude={usersToExclude} 318 | ``` 319 | 320 | In the url you can set: 321 | 322 | - **usersToExport**: comma separated list of users to export, if not present all the users will be exported 323 | - **groupsToExport**: comma separated list of groups to export, if not present all the groups will be exported 324 | - **excludeSiteGroups**: boolean (TRUE/FALSE), determines whether to exclude or not Site Groups 325 | - **groupsToExclude**: comma separated list of groups to export, if not present all the groups will be exported. IGNORED if groupsToExport is present 326 | - **usersToExclude**: comma separated list of users to export, if not present all the users will be exported. IGNORED if usersToExport is present 327 | 328 | **NOTE:** to avoid conflicts the authorities api won't export the following users: 329 | 330 | - admin 331 | - guest 332 | - mjackson 333 | - abeecher 334 | -------------------------------------------------------------------------------- /alfresco-demo-data-exporter-repo-amp/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | alfresco-demo-data-exporter-repo-amp 5 | Alfresco Repository AMP Module 6 | amp 7 | This is a sample Alfresco repository AMP project, depended upon by the alfresco WAR aggregator 8 | 9 | 10 | org.alfresco.devops 11 | alfresco-demo-data 12 | 0.7-SNAPSHOT 13 | 14 | 15 | 16 | 17 | 18 | 19 | 22 | 23 | 24 | ${alfresco.groupId} 25 | alfresco-repository 26 | 27 | 28 | com.google.code.gson 29 | gson 30 | 2.4 31 | 32 | 34 | 43 | 44 | 45 | org.alfresco 46 | alfresco-remote-api 47 | 48 | 49 | 50 | 51 | 52 | 54 | 55 | enterprise 56 | 57 | 58 | ${alfresco.groupId} 59 | alfresco-enterprise-repository 60 | ${alfresco.version} 61 | provided 62 | 63 | 64 | 65 | 66 | 67 | 68 | run 69 | 70 | true 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /alfresco-demo-data-exporter-repo-amp/src/main/amp/config/alfresco/extension/templates/webscripts/org/alfresco/devops/exporters/categoriesacpexporter.get.desc.xml: -------------------------------------------------------------------------------- 1 | 2 | Export Categories 3 | 4 | 6 | /api/categories/export?crawlSelf={crawlSelf}&crawlChildNodes={crawlChildNodes}&crawlContent={crawlContent}&crawlAssociations={crawlAssociations} 7 | argument 8 | admin 9 | required 10 | internal 11 | alfresco-demo-data-exporters 12 | -------------------------------------------------------------------------------- /alfresco-demo-data-exporter-repo-amp/src/main/amp/config/alfresco/extension/templates/webscripts/org/alfresco/devops/exporters/filesfolderacpexporter.get.desc.xml: -------------------------------------------------------------------------------- 1 | 2 | Export People,Users,Groups 3 | 4 | 6 | /api/file-folder/export?path={path}&crawlSelf={crawlSelf}&crawlChildNodes={crawlChildNodes}&crawlContent={crawlContent}&crawlAssociations={crawlAssociations} 7 | argument 8 | admin 9 | required 10 | internal 11 | alfresco-demo-data-exporters 12 | -------------------------------------------------------------------------------- /alfresco-demo-data-exporter-repo-amp/src/main/amp/config/alfresco/extension/templates/webscripts/org/alfresco/devops/exporters/peopleusersgroupacpexporter.get.desc.xml: -------------------------------------------------------------------------------- 1 | 2 | Export People,Users,Groups 3 | 4 | 6 | /api/people-groups/export?usersToExport={usersToExport}&groupsToExport={groupsToExport}&excludeSiteGroups={excludeSiteGroups}&groupsToExclude={groupsToExclude}&usersToExclude={usersToExclude}&prettyJson={prettyJson} 7 | argument 8 | admin 9 | required 10 | internal 11 | alfresco-demo-data-exporters 12 | 13 | -------------------------------------------------------------------------------- /alfresco-demo-data-exporter-repo-amp/src/main/amp/config/alfresco/extension/templates/webscripts/org/alfresco/devops/smartfolders/enablesf.get.desc.xml: -------------------------------------------------------------------------------- 1 | 2 | Enable/Disable Smart Folders 3 | /api/smart-folders?enable={enable} 4 | argument 5 | admin 6 | required 7 | internal 8 | alfresco-demo-data-exporters 9 | -------------------------------------------------------------------------------- /alfresco-demo-data-exporter-repo-amp/src/main/amp/config/alfresco/extension/templates/webscripts/org/alfresco/devops/smartfolders/enablesf.get.js: -------------------------------------------------------------------------------- 1 | var ctx = Packages.org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext(); 2 | var smartFoldersBundle = ctx.getBean("smartFoldersBundle",org.alfresco.traitextender.SpringExtensionBundle); 3 | if(smartFoldersBundle){ 4 | if(args.enable && args.enable.toUpperCase() === "FALSE"){ 5 | smartFoldersBundle.stop(); 6 | model.enabled=false; 7 | } 8 | else{ 9 | smartFoldersBundle.start(); 10 | model.enabled=true; 11 | } 12 | model.message="OK"; 13 | 14 | } 15 | else{ 16 | model.enabled=false; 17 | model.message="Smart Folders not available"; 18 | } -------------------------------------------------------------------------------- /alfresco-demo-data-exporter-repo-amp/src/main/amp/config/alfresco/extension/templates/webscripts/org/alfresco/devops/smartfolders/enablesf.get.json.ftl: -------------------------------------------------------------------------------- 1 | { 2 | <#if enabled??> 3 | "enabled": "${enabled?c}" 4 | 5 | <#if message??> 6 | ,"message": "${message}" 7 | 8 | } 9 | -------------------------------------------------------------------------------- /alfresco-demo-data-exporter-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-exporter-repo-amp/alfresco-global.properties: -------------------------------------------------------------------------------- 1 | ## This Alfresco Repo Configuration file should be used for custom properties that are introduced by this module. 2 | ## Define default values for all properties here. 3 | ## System Administrators can override these values in environment specific configurations in 4 | ## alfresco/tomcat/shared/classes/alfresco-global.properties. 5 | ## 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /alfresco-demo-data-exporter-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-exporter-repo-amp/context/service-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | alfresco/module/${project.artifactId}/model/demo-data-exporter-model.xml 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /alfresco-demo-data-exporter-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-exporter-repo-amp/log4j.properties: -------------------------------------------------------------------------------- 1 | #log4j.logger.org.alfresco.devops.exporters=WARN 2 | #log4j.logger.org.alfresco.repo.model.filefolder=TRACE -------------------------------------------------------------------------------- /alfresco-demo-data-exporter-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-exporter-repo-amp/model/demo-data-exporter-model.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Document Model for Demo Data Exporter 6 | Alfresco Devops 7 | 1.0 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | Ignore Export 23 | Ignore export when aspect applied 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /alfresco-demo-data-exporter-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-exporter-repo-amp/module-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /alfresco-demo-data-exporter-repo-amp/src/main/amp/module.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | 18 | # SDK Sample module 19 | 20 | # ==== Beginning of Alfresco required/optional properties ====== # 21 | 22 | module.id=${project.artifactId} 23 | #module.aliases=myModule-123, my-module 24 | module.title=${project.name} 25 | module.description=${project.description} 26 | module.version=${noSnapshotVersion} 27 | 28 | # The following optional properties can be used to prevent the module from being added 29 | # to inappropriate versions of the WAR file. 30 | # module.repo.version.min=2.0 31 | # module.repo.version.max=2.1 32 | 33 | # FIXME: This dependencies should come out of mvn dependencies on amp 34 | 35 | # The following describe dependencies on other modules 36 | # Depends on net.sf.myproject.module.SupportModuleA version ${version} or later 37 | # module.depends.net.sf.myproject.module.SupportModuleA=${version}-* 38 | # Depends on net.sf.myproject.module.SupportModuleA version ${version} to 2.0 39 | # module.depends.net.sf.myproject.module.SupportModuleB=${version}-2.0 40 | # Depends on net.sf.myproject.module.SupportModuleC - any version 41 | # module.depends.net.sf.myproject.module.SupportModuleB=* 42 | #module.depends.org_alfresco_module_rm=* 43 | 44 | # ==== End of Alfresco required/optional properties ======= # 45 | 46 | 47 | # ==== Beginning of module required properties/optional ====== # -------------------------------------------------------------------------------- /alfresco-demo-data-exporter-repo-amp/src/main/java/org/alfresco/devops/exporter/util/Constants.java: -------------------------------------------------------------------------------- 1 | package org.alfresco.devops.exporter.util; 2 | 3 | public final class Constants { 4 | 5 | public static final String GROUP_NAME = "name"; 6 | public static final String GROUP_DISPLAYNAME = "displayName"; 7 | public static final String GROUP_MEMBERS = "members"; 8 | public static final String GROUP_ZONES = "zones"; 9 | public static final String GROUP_SUBGROUPS = "groups"; 10 | public static final String GROUPS = "groups"; 11 | public static final String PEOPLE = "people"; 12 | public static final String USERS = "users"; 13 | public static final String LOCATION = "location"; 14 | public static final String ID = "id"; 15 | public static final String DISABLED = "disabled"; 16 | public static final String BOOTSTRAPVIEWS = "bootstrapViews"; 17 | public static final String CONTENTS = "contents"; 18 | public static final String SITENAME = "siteName"; 19 | public static final String MODULE_PATH="alfresco/module"; 20 | public static final String UTF8="UTF-8"; 21 | 22 | 23 | private Constants(){ 24 | throw new AssertionError(); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /alfresco-demo-data-exporter-repo-amp/src/main/java/org/alfresco/devops/exporter/util/Utils.java: -------------------------------------------------------------------------------- 1 | package org.alfresco.devops.exporter.util; 2 | 3 | public final class Utils { 4 | 5 | private Utils(){ 6 | throw new AssertionError(); 7 | }; 8 | 9 | public static boolean isNullOrEmpty(String paramSelf) { 10 | return paramSelf == null || paramSelf.trim().isEmpty(); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /alfresco-demo-data-exporter-repo-amp/src/main/java/org/alfresco/devops/exporters/CategoriesAcpExporter.java: -------------------------------------------------------------------------------- 1 | package org.alfresco.devops.exporters; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | import org.alfresco.repo.content.MimetypeMap; 9 | import org.alfresco.repo.exporter.ACPExportPackageHandler; 10 | import org.alfresco.service.cmr.repository.MimetypeService; 11 | import org.alfresco.service.cmr.repository.NodeRef; 12 | import org.alfresco.service.cmr.repository.NodeService; 13 | import org.alfresco.service.cmr.repository.StoreRef; 14 | import org.alfresco.service.cmr.search.ResultSet; 15 | import org.alfresco.service.cmr.search.SearchService; 16 | import org.alfresco.service.cmr.view.ExporterCrawlerParameters; 17 | import org.alfresco.service.cmr.view.ExporterService; 18 | import org.alfresco.service.cmr.view.Location; 19 | import org.apache.commons.logging.Log; 20 | import org.apache.commons.logging.LogFactory; 21 | import org.springframework.extensions.webscripts.AbstractWebScript; 22 | import org.springframework.extensions.webscripts.WebScriptException; 23 | import org.springframework.extensions.webscripts.WebScriptRequest; 24 | import org.springframework.extensions.webscripts.WebScriptResponse; 25 | 26 | public class CategoriesAcpExporter extends AbstractWebScript{ 27 | 28 | private MimetypeService mimetypeService; 29 | private ExporterService exporterService; 30 | private NodeService nodeService; 31 | private SearchService searchService; 32 | 33 | private static Log logger = LogFactory.getLog(CategoriesAcpExporter.class); 34 | 35 | 36 | private static final String PARAM_PATH = "path"; 37 | private static final String PARAM_CRAWL_SELF = "crawlSelf"; 38 | private static final String PARAM_CRAWL_CHILD_NODES = "crawlChildNodes"; 39 | private static final String PARAM_CRAWL_CONTENT = "crawlContent"; 40 | private static final String PARAM_CRAWL_ASSOCIATIONS = "crawlAssociations"; 41 | 42 | 43 | 44 | @Override 45 | public void execute(WebScriptRequest req, WebScriptResponse res) 46 | throws IOException { 47 | 48 | 49 | String path = req.getParameter(PARAM_PATH); 50 | 51 | String paramSelf = req.getParameter(PARAM_CRAWL_SELF); 52 | String paramChildNodes = req.getParameter(PARAM_CRAWL_CHILD_NODES); 53 | String paramCrawlContent = req.getParameter(PARAM_CRAWL_CONTENT); 54 | String paramCrawlAssociations = req.getParameter(PARAM_CRAWL_ASSOCIATIONS); 55 | 56 | boolean crawlSelf = isNullOrEmpty(paramSelf) ? true : Boolean.parseBoolean(paramSelf); 57 | boolean crawlChildNodes = isNullOrEmpty(paramChildNodes) ? true : Boolean.parseBoolean(paramChildNodes); 58 | boolean crawlContent = isNullOrEmpty(paramCrawlContent) ? true : Boolean.parseBoolean(paramCrawlContent); 59 | boolean crawlAssociations = isNullOrEmpty(paramCrawlAssociations) ? true : Boolean.parseBoolean(paramCrawlAssociations); 60 | 61 | try 62 | { 63 | // if(isNullOrEmpty(path)){ 64 | // throw new WebScriptException("No Path Parameter Specified in the URL"); 65 | // } 66 | 67 | List nodes = new ArrayList(); 68 | 69 | 70 | ResultSet rs = searchService.query(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, "lucene","PATH:\"/cm:categoryRoot\"", null); 71 | NodeRef nr = rs.getNodeRef(0); 72 | nodes.add(nr); 73 | rs.close(); 74 | 75 | logger.debug("Exporting Parameters: crawlSelf="+crawlSelf+" crawlChildNodes="+crawlChildNodes+" crawlContent="+crawlContent+ " crawlAssociations="+crawlAssociations); 76 | 77 | res.setContentType(MimetypeMap.MIMETYPE_ACP); 78 | res.setHeader("Content-Disposition","attachment; fileName=CategoriesExport." + ACPExportPackageHandler.ACP_EXTENSION); 79 | 80 | NodeRef[] lnodes = nodes.toArray(new NodeRef[nodes.size()]); 81 | 82 | ExporterCrawlerParameters parameters = new ExporterCrawlerParameters(); 83 | parameters.setExportFrom(new Location(lnodes)); 84 | parameters.setCrawlChildNodes(crawlChildNodes); 85 | parameters.setCrawlSelf(false); 86 | parameters.setCrawlContent(crawlContent); 87 | parameters.setCrawlAssociations(crawlAssociations); 88 | 89 | // And the export handler 90 | ACPExportPackageHandler handler = new ACPExportPackageHandler(res.getOutputStream(),new File("categories.xml"),new File("categories"),mimetypeService); 91 | handler.setNodeService(nodeService); 92 | handler.setExportAsFolders(false); 93 | // Do the export 94 | exporterService.exportView(handler, parameters, null); 95 | 96 | } 97 | catch(WebScriptException e){ 98 | res.setContentType(MimetypeMap.MIMETYPE_TEXT_PLAIN); 99 | res.getOutputStream().write(e.getMessage().getBytes()); 100 | } 101 | 102 | catch (Exception e) 103 | { 104 | res.setContentType(MimetypeMap.MIMETYPE_TEXT_PLAIN); 105 | StringBuffer text = new StringBuffer(); 106 | text.append("Error occurred during export:"); 107 | text.append("\n"); 108 | text.append(e.getMessage()); 109 | byte[] bytes = text.toString().getBytes(); 110 | res.getOutputStream().write(bytes); 111 | logger.error("Error occurred during export",e); 112 | } 113 | 114 | 115 | 116 | 117 | } 118 | 119 | 120 | 121 | private boolean isNullOrEmpty(String paramSelf) { 122 | return paramSelf == null || paramSelf.trim().isEmpty(); 123 | } 124 | 125 | 126 | 127 | public void setMimetypeService(MimetypeService mimetypeService) { 128 | this.mimetypeService = mimetypeService; 129 | } 130 | 131 | 132 | 133 | public void setExporterService(ExporterService exporterService) { 134 | this.exporterService = exporterService; 135 | } 136 | 137 | 138 | 139 | 140 | public void setNodeService(NodeService nodeService) { 141 | this.nodeService = nodeService; 142 | } 143 | 144 | 145 | 146 | public void setSearchService(SearchService searchService) { 147 | this.searchService = searchService; 148 | } 149 | 150 | } 151 | -------------------------------------------------------------------------------- /alfresco-demo-data-exporter-repo-amp/src/main/java/org/alfresco/devops/exporters/FileFolderAcpExporter.java: -------------------------------------------------------------------------------- 1 | package org.alfresco.devops.exporters; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | import java.util.ArrayList; 6 | import java.util.Arrays; 7 | import java.util.List; 8 | 9 | import org.alfresco.devops.exporter.util.Utils; 10 | import org.alfresco.repo.content.MimetypeMap; 11 | import org.alfresco.repo.exporter.ACPExportPackageHandler; 12 | import org.alfresco.repo.model.Repository; 13 | import org.alfresco.service.cmr.model.FileFolderService; 14 | import org.alfresco.service.cmr.model.FileInfo; 15 | import org.alfresco.service.cmr.model.FileNotFoundException; 16 | import org.alfresco.service.cmr.repository.MimetypeService; 17 | import org.alfresco.service.cmr.repository.NodeRef; 18 | import org.alfresco.service.cmr.repository.NodeService; 19 | import org.alfresco.service.cmr.view.ExporterCrawlerParameters; 20 | import org.alfresco.service.cmr.view.ExporterService; 21 | import org.alfresco.service.cmr.view.Location; 22 | import org.apache.commons.logging.Log; 23 | import org.apache.commons.logging.LogFactory; 24 | import org.springframework.extensions.webscripts.AbstractWebScript; 25 | import org.springframework.extensions.webscripts.WebScriptException; 26 | import org.springframework.extensions.webscripts.WebScriptRequest; 27 | import org.springframework.extensions.webscripts.WebScriptResponse; 28 | 29 | public class FileFolderAcpExporter extends AbstractWebScript{ 30 | 31 | private MimetypeService mimetypeService; 32 | private ExporterService exporterService; 33 | private FileFolderService fileFolderService; 34 | private NodeService nodeService; 35 | 36 | 37 | private static Log logger = LogFactory.getLog(FileFolderAcpExporter.class); 38 | 39 | 40 | private static final String PARAM_PATH = "path"; 41 | private static final String PARAM_CRAWL_SELF = "crawlSelf"; 42 | private static final String PARAM_CRAWL_CHILD_NODES = "crawlChildNodes"; 43 | private static final String PARAM_CRAWL_CONTENT = "crawlContent"; 44 | private static final String PARAM_CRAWL_ASSOCIATIONS = "crawlAssociations"; 45 | private static Repository repositoryHelper; 46 | 47 | 48 | 49 | @Override 50 | public void execute(WebScriptRequest req, WebScriptResponse res) 51 | throws IOException { 52 | 53 | 54 | String path = req.getParameter(PARAM_PATH); 55 | 56 | String paramSelf = req.getParameter(PARAM_CRAWL_SELF); 57 | String paramChildNodes = req.getParameter(PARAM_CRAWL_CHILD_NODES); 58 | String paramCrawlContent = req.getParameter(PARAM_CRAWL_CONTENT); 59 | String paramCrawlAssociations = req.getParameter(PARAM_CRAWL_ASSOCIATIONS); 60 | 61 | boolean crawlSelf = Utils.isNullOrEmpty(paramSelf) ? true : Boolean.parseBoolean(paramSelf); 62 | boolean crawlChildNodes = Utils.isNullOrEmpty(paramChildNodes) ? true : Boolean.parseBoolean(paramChildNodes); 63 | boolean crawlContent = Utils.isNullOrEmpty(paramCrawlContent) ? true : Boolean.parseBoolean(paramCrawlContent); 64 | boolean crawlAssociations = Utils.isNullOrEmpty(paramCrawlAssociations) ? true : Boolean.parseBoolean(paramCrawlAssociations); 65 | 66 | try 67 | { 68 | if(Utils.isNullOrEmpty(path)){ 69 | throw new WebScriptException("No Path Parameter Specified in the URL"); 70 | } 71 | 72 | String[] els = path.split(","); 73 | List nodes = new ArrayList(); 74 | 75 | String exportName="multiple-contents-"+System.currentTimeMillis(); 76 | 77 | for(String el:els){ 78 | 79 | List pathElements = new ArrayList(Arrays.asList(el.split("/"))); 80 | 81 | pathElements.removeAll(Arrays.asList("", null)); 82 | 83 | //Will search just inside Company Home 84 | FileInfo fi = fileFolderService.resolveNamePath(repositoryHelper.getCompanyHome(), pathElements); 85 | 86 | if(els.length==1){ 87 | exportName = fi.getName().replaceAll("[ .]", "_"); 88 | } 89 | NodeRef nr = fi.getNodeRef(); 90 | nodes.add(nr); 91 | 92 | if(logger.isDebugEnabled()){ 93 | logger.debug("Exporting "+(fi.isFolder() ? "folder " : "node '") +exportName +"' , nodeRef: "+nr); 94 | } 95 | } 96 | 97 | logger.debug("Exporting Parameters: crawlSelf="+crawlSelf+" crawlChildNodes="+crawlChildNodes+" crawlContent="+crawlContent+ " crawlAssociations="+crawlAssociations); 98 | 99 | res.setContentType(MimetypeMap.MIMETYPE_ACP); 100 | res.setHeader("Content-Disposition","attachment; fileName="+exportName+"." + ACPExportPackageHandler.ACP_EXTENSION); 101 | 102 | NodeRef[] lnodes = nodes.toArray(new NodeRef[nodes.size()]); 103 | 104 | ExporterCrawlerParameters parameters = new ExporterCrawlerParameters(); 105 | parameters.setExportFrom(new Location(lnodes)); 106 | parameters.setCrawlChildNodes(crawlChildNodes); 107 | parameters.setCrawlSelf(crawlSelf); 108 | parameters.setCrawlContent(crawlContent); 109 | parameters.setCrawlAssociations(crawlAssociations); 110 | 111 | // And the export handler 112 | ACPExportPackageHandler handler = new ACPExportPackageHandler(res.getOutputStream(),new File("files.xml"),new File("files"),mimetypeService); 113 | handler.setNodeService(nodeService); 114 | handler.setExportAsFolders(false); 115 | // Do the export 116 | exporterService.exportView(handler, parameters, null); 117 | 118 | } 119 | catch (FileNotFoundException e) 120 | { 121 | res.setContentType(MimetypeMap.MIMETYPE_TEXT_PLAIN); 122 | String text = "Path "+path+" not available \nUse existing path inside Company Home \nexamples:\n path=/Data Dictionary/Scripts\npath=/Sites/Scripts"; 123 | byte[] bytes = text.getBytes(); 124 | res.getOutputStream().write(bytes); 125 | } 126 | catch(WebScriptException e){ 127 | res.setContentType(MimetypeMap.MIMETYPE_TEXT_PLAIN); 128 | res.getOutputStream().write(e.getMessage().getBytes()); 129 | } 130 | 131 | catch (Exception e) 132 | { 133 | res.setContentType(MimetypeMap.MIMETYPE_TEXT_PLAIN); 134 | StringBuffer text = new StringBuffer(); 135 | text.append("Error occurred during export:"); 136 | text.append("\n"); 137 | text.append(e.getMessage()); 138 | byte[] bytes = text.toString().getBytes(); 139 | res.getOutputStream().write(bytes); 140 | logger.error("Error occurred during export",e); 141 | } 142 | 143 | 144 | 145 | 146 | } 147 | 148 | 149 | 150 | public void setMimetypeService(MimetypeService mimetypeService) { 151 | this.mimetypeService = mimetypeService; 152 | } 153 | 154 | 155 | 156 | public void setExporterService(ExporterService exporterService) { 157 | this.exporterService = exporterService; 158 | } 159 | 160 | 161 | 162 | public static void setRepositoryHelper(Repository repositoryHelper) { 163 | FileFolderAcpExporter.repositoryHelper = repositoryHelper; 164 | } 165 | 166 | 167 | 168 | public void setFileFolderService(FileFolderService fileFolderService) { 169 | this.fileFolderService = fileFolderService; 170 | } 171 | 172 | 173 | 174 | public void setNodeService(NodeService nodeService) { 175 | this.nodeService = nodeService; 176 | } 177 | 178 | } 179 | -------------------------------------------------------------------------------- /alfresco-demo-data-exporter-repo-amp/src/test/properties/local/alfresco-global.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | ######################################################################################################################## 17 | # Alfresco configuration for running locally 18 | # 19 | # Configuration when running Tomcat embedded from Maven. 20 | # This will create the alf_data_dev directory relative to Tomcat run folder. 21 | # Property values from the POM but it can also be edited here. 22 | ######################################################################################################################## 23 | 24 | dir.root=${alfresco.data.location} 25 | 26 | # Use Solr4 as that is used by default with Alfresco 5 27 | index.subsystem.name=solr4 28 | solr.host=localhost 29 | solr.port=8080 30 | solr.secureComms=none 31 | 32 | # Fail or not when there are node integrity checker errors 33 | integrity.failOnError=true 34 | 35 | # Database connection properties 36 | db.driver=${alfresco.db.datasource.class} 37 | db.url=${alfresco.db.url} 38 | db.username=${alfresco.db.username} 39 | db.password=${alfresco.db.password} 40 | db.pool.initial=10 41 | db.pool.max=100 42 | hibernate.dialect=org.hibernate.dialect.H2Dialect 43 | 44 | # File servers related properties 45 | # For local runs we disable CIFS and FTP 46 | cifs.enabled=false 47 | ftp.enabled=false -------------------------------------------------------------------------------- /alfresco-demo-data-exporter-repo-amp/src/test/resources/alfresco/extension/disable-webscript-caching-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 21 | 22 | 23 | javascript 24 | 25 | 26 | js 27 | 28 | 29 | 30 | false 31 | 32 | 33 | 34 | 35 | true 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | ${spaces.store} 46 | 47 | 48 | ${spaces.company_home.childname} 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /alfresco-demo-data-exporter-repo-amp/src/test/resources/test-log4j.properties: -------------------------------------------------------------------------------- 1 | # Overrides only log4j locations and add the test logging properties 2 | # This gets merged with the main file 3 | 4 | # Set root logger level to error 5 | log4j.rootLogger=${app.log.root.level}, Console, File 6 | 7 | ###### Console appender definition ####### 8 | 9 | # All outputs currently set to be a ConsoleAppender. 10 | log4j.appender.Console=org.apache.log4j.ConsoleAppender 11 | log4j.appender.Console.layout=org.apache.log4j.PatternLayout 12 | 13 | # use log4j NDC to replace %x with tenant domain / username 14 | log4j.appender.Console.layout.ConversionPattern=%d{ISO8601} %x %-5p [%c{3}] [%t] %m%n 15 | #log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n 16 | 17 | ###### File appender definition ####### 18 | log4j.appender.File=org.apache.log4j.DailyRollingFileAppender 19 | log4j.appender.File.File=${app.log.dir}alfresco.log 20 | log4j.appender.File.Append=true 21 | log4j.appender.File.DatePattern='.'yyyy-MM-dd 22 | log4j.appender.File.layout=org.apache.log4j.PatternLayout 23 | log4j.appender.File.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | alfresco-demo-data-repo-amp 5 | Alfresco Repository AMP Module 6 | amp 7 | This is a sample Alfresco repository AMP project, depended upon by the alfresco WAR aggregator 8 | 9 | 10 | org.alfresco.devops 11 | alfresco-demo-data 12 | 0.7-SNAPSHOT 13 | 14 | 15 | 16 | 17 | 18 | 19 | 22 | 23 | 24 | ${alfresco.groupId} 25 | alfresco-repository 26 | 27 | 28 | 29 | 30 | 31 | 32 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | org.alfresco 46 | alfresco-remote-api 47 | 48 | 49 | 50 | 51 | 52 | 54 | 55 | enterprise 56 | 57 | 58 | ${alfresco.groupId} 59 | alfresco-enterprise-repository 60 | ${alfresco.version} 61 | provided 62 | 63 | 64 | 65 | 66 | 67 | 68 | run 69 | 70 | true 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/messages/boostrap-messages.properties: -------------------------------------------------------------------------------- 1 | patch.repoImport.description=Loads files into Data Dictionary folder 2 | patch.authorities.users.description=Patch to load Users + People 3 | patch.authorities.groups.description=Patch to load Groups 4 | patch.demoData.sites.description=Patch to load a Site 5 | patch.contentFormFolderType=Content Form Folder Type 6 | patch.redeploySubmitProcess=Redeploy Submit Process 7 | patch.RMSite.description=Patch to fix Map d:any properties converted to text 8 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/alfresco-global.properties: -------------------------------------------------------------------------------- 1 | ## This Alfresco Repo Configuration file should be used for custom properties that are introduced by this module. 2 | ## Define default values for all properties here. 3 | ## System Administrators can override these values in environment specific configurations in 4 | ## alfresco/tomcat/shared/classes/alfresco-global.properties. 5 | ## 6 | 7 | ## SITES 8 | #companyRebranding.site.disabled=false 9 | #brandAwarenessCampaign.site.disabled=false 10 | #companyReports.site.disabled=false 11 | #contracts.site.disabled=false 12 | #customerServiceCaseFiles.site.disabled=false 13 | #engineeringDevelopment.site.disabled=false 14 | #globalSalesEnablement.site.disabled=false 15 | #hrFiles.site.disabled=false 16 | #marketing.site.disabled=false 17 | #marketingImageGallery.site.disabled=false 18 | #salesOperations.site.disabled=false 19 | #rm.site.disabled=false 20 | 21 | ## USERS - GROUPS 22 | #dynamic.authorities.demoData.disabled=true 23 | #dynamic.sites.demoData.disabled=true 24 | 25 | ## SAMPLE SITE 26 | sample.site.disabled=true 27 | 28 | smart.folders.enabled=true 29 | smart.folders.config.type.templates.qname.filter=clex:claimFolder 30 | 31 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/authorities/People.acp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlfrescoArchive/alfresco-demo-data/3faa286dedb8722320814a1552ff39800f16df89/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/authorities/People.acp -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/authorities/Users.acp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlfrescoArchive/alfresco-demo-data/3faa286dedb8722320814a1552ff39800f16df89/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/authorities/Users.acp -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/repo/app:company_home/app:dictionary/Solr-Facets-Space.acp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlfrescoArchive/alfresco-demo-data/3faa286dedb8722320814a1552ff39800f16df89/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/repo/app:company_home/app:dictionary/Solr-Facets-Space.acp -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/repo/app:company_home/app:dictionary/app:models/Models.acp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlfrescoArchive/alfresco-demo-data/3faa286dedb8722320814a1552ff39800f16df89/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/repo/app:company_home/app:dictionary/app:models/Models.acp -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/repo/app:company_home/app:dictionary/app:scripts/custom-scripts.acp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlfrescoArchive/alfresco-demo-data/3faa286dedb8722320814a1552ff39800f16df89/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/repo/app:company_home/app:dictionary/app:scripts/custom-scripts.acp -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/repo/app:company_home/app:dictionary/app:scripts/vf-custom-scripts.acp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlfrescoArchive/alfresco-demo-data/3faa286dedb8722320814a1552ff39800f16df89/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/repo/app:company_home/app:dictionary/app:scripts/vf-custom-scripts.acp -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/repo/app:company_home/app:dictionary/app:smart_folders/Smart_Folder_Templates.acp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlfrescoArchive/alfresco-demo-data/3faa286dedb8722320814a1552ff39800f16df89/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/repo/app:company_home/app:dictionary/app:smart_folders/Smart_Folder_Templates.acp -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/repo/app:company_home/st:sites/cm:surf-config/cm:extensions/extensions.acp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlfrescoArchive/alfresco-demo-data/3faa286dedb8722320814a1552ff39800f16df89/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/repo/app:company_home/st:sites/cm:surf-config/cm:extensions/extensions.acp -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/repo/app:company_home/st:sites/cm:surf-config/cm:module-deployments/module-deployments.acp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlfrescoArchive/alfresco-demo-data/3faa286dedb8722320814a1552ff39800f16df89/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/repo/app:company_home/st:sites/cm:surf-config/cm:module-deployments/module-deployments.acp -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites/accounting/Contents.acp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlfrescoArchive/alfresco-demo-data/3faa286dedb8722320814a1552ff39800f16df89/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites/accounting/Contents.acp -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites/engineering-projects/Contents.acp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlfrescoArchive/alfresco-demo-data/3faa286dedb8722320814a1552ff39800f16df89/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites/engineering-projects/Contents.acp -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites/executive-team/Contents.acp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlfrescoArchive/alfresco-demo-data/3faa286dedb8722320814a1552ff39800f16df89/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites/executive-team/Contents.acp -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites/hr-team/Contents.acp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlfrescoArchive/alfresco-demo-data/3faa286dedb8722320814a1552ff39800f16df89/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites/hr-team/Contents.acp -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites/marketing-site/Contents.acp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlfrescoArchive/alfresco-demo-data/3faa286dedb8722320814a1552ff39800f16df89/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites/marketing-site/Contents.acp -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites/rm/Contents.acp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlfrescoArchive/alfresco-demo-data/3faa286dedb8722320814a1552ff39800f16df89/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites/rm/Contents.acp -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites/sales-enablement/Contents.acp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlfrescoArchive/alfresco-demo-data/3faa286dedb8722320814a1552ff39800f16df89/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites/sales-enablement/Contents.acp -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites/smart-folders/Contents.acp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlfrescoArchive/alfresco-demo-data/3faa286dedb8722320814a1552ff39800f16df89/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites/smart-folders/Contents.acp -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites/social-media/Contents.acp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlfrescoArchive/alfresco-demo-data/3faa286dedb8722320814a1552ff39800f16df89/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites/social-media/Contents.acp -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites/support-case-files/Contents.acp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlfrescoArchive/alfresco-demo-data/3faa286dedb8722320814a1552ff39800f16df89/alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites/support-case-files/Contents.acp -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/workflows/labels/scWorkflow.properties: -------------------------------------------------------------------------------- 1 | 2 | # Workflow related strings 3 | 4 | helloWorldUI.workflow.title=Hello World UI (Activiti) 5 | helloWorldUI.workflow.description=A simple hello world process using Activiti 6 | 7 | publishWhitepaper.workflow.title=Publish Whitepaper to Web (Activiti) 8 | publishWhitepaper.workflow.description=Review and approve Someco Whitepaper content using Activiti 9 | 10 | # Workflow Model related strings 11 | 12 | scwf_workflowmodel.type.scwf_submitHelloWorldTask.title=Start Hello World UI Workflow 13 | scwf_workflowmodel.type.scwf_submitHelloWorldTask.description=Submit a workflow that says hello in the log 14 | scwf_workflowmodel.type.scwf_submitReviewTask.title=Start Someco Web Review 15 | scwf_workflowmodel.type.scwf_submitReviewTask.description=Submit Someco Web documents for review & approval to a group of people 16 | scwf_workflowmodel.type.scwf_activitiMarketingReview.title=Marketing Review 17 | scwf_workflowmodel.type.scwf_activitiMarketingReview.description=Review documents for impact on Someco marketing message 18 | scwf_workflowmodel.type.scwf_activitiOperationsReview.title=Operations Review 19 | scwf_workflowmodel.type.scwf_activitiOperationsReview.description=Review documents for technical accuracy and best practices 20 | scwf_workflowmodel.type.scwf_activitiThirdPartyReview.title=Third Party Review 21 | scwf_workflowmodel.type.scwf_activitiThirdPartyReview.description=Obtain third party approval 22 | scwf_workflowmodel.type.scwf_activitiRevise.title=Revise 23 | scwf_workflowmodel.type.scwf_activitiRevise.description=Make changes then resubmit or abort 24 | scwf_workflowmodel.type.scwf_activitiReviewTask.title=Review 25 | scwf_workflowmodel.type.scwf_activitiReviewTask.description=Approve or reject this change 26 | 27 | scwf_workflowmodel.property.scwf_helloName.title=Name 28 | scwf_workflowmodel.property.scwf_helloName.description=Say hello to this person 29 | scwf_workflowmodel.property.scwf_reviewerEmail.title=Reviewer email 30 | scwf_workflowmodel.property.scwf_reviewerEmail.description=Third-party reviewer email address 31 | scwf_workflowmodel.property.scwf_approveRejectOutcome.title=Outcome 32 | scwf_workflowmodel.property.scwf_approveRejectOutcome.description=Reviewer outcome 33 | scwf_workflowmodel.property.scwf_reviseOutcome.title=Outcome 34 | scwf_workflowmodel.property.scwf_reviseOutcome.description=Reviewer outcome 35 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/workflows/labels/scWorkflow_en.properties: -------------------------------------------------------------------------------- 1 | 2 | # Workflow related strings 3 | 4 | helloWorldUI.workflow.title=Hello World UI (Activiti) 5 | helloWorldUI.workflow.description=A simple hello world process using Activiti 6 | 7 | publishWhitepaper.workflow.title=Publish Whitepaper to Web (Activiti) 8 | publishWhitepaper.workflow.description=Review and approve Someco Whitepaper content using Activiti 9 | 10 | # Workflow Model related strings 11 | 12 | scwf_workflowmodel.type.scwf_submitHelloWorldTask.title=Start Hello World UI Workflow 13 | scwf_workflowmodel.type.scwf_submitHelloWorldTask.description=Submit a workflow that says hello in the log 14 | scwf_workflowmodel.type.scwf_submitReviewTask.title=Start Someco Web Review 15 | scwf_workflowmodel.type.scwf_submitReviewTask.description=Submit Someco Web documents for review & approval to a group of people 16 | scwf_workflowmodel.type.scwf_activitiMarketingReview.title=Marketing Review 17 | scwf_workflowmodel.type.scwf_activitiMarketingReview.description=Review documents for impact on Someco marketing message 18 | scwf_workflowmodel.type.scwf_activitiOperationsReview.title=Operations Review 19 | scwf_workflowmodel.type.scwf_activitiOperationsReview.description=Review documents for technical accuracy and best practices 20 | scwf_workflowmodel.type.scwf_activitiThirdPartyReview.title=Third Party Review 21 | scwf_workflowmodel.type.scwf_activitiThirdPartyReview.description=Obtain third party approval 22 | scwf_workflowmodel.type.scwf_activitiRevise.title=Revise 23 | scwf_workflowmodel.type.scwf_activitiRevise.description=Make changes then resubmit or abort 24 | scwf_workflowmodel.type.scwf_activitiReviewTask.title=Review 25 | scwf_workflowmodel.type.scwf_activitiReviewTask.description=Approve or reject this change 26 | 27 | scwf_workflowmodel.property.scwf_helloName.title=Name 28 | scwf_workflowmodel.property.scwf_helloName.description=Say hello to this person 29 | scwf_workflowmodel.property.scwf_reviewerEmail.title=Reviewer email 30 | scwf_workflowmodel.property.scwf_reviewerEmail.description=Third-party reviewer email address 31 | scwf_workflowmodel.property.scwf_approveRejectOutcome.title=Outcome 32 | scwf_workflowmodel.property.scwf_approveRejectOutcome.description=Reviewer outcome 33 | scwf_workflowmodel.property.scwf_reviseOutcome.title=Outcome 34 | scwf_workflowmodel.property.scwf_reviseOutcome.description=Reviewer outcome 35 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/workflows/models/scWorkflowModel.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | 7 | Someco Workflow Model 8 | Jeff Potts 9 | 1.0 10 | 11 | 12 | 13 | 15 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | bpm:startTask 28 | 29 | 30 | d:text 31 | true 32 | false 33 | 34 | 35 | 36 | 37 | 38 | bpm:startTask 39 | 40 | scwf:thirdPartyReviewable 41 | 42 | 43 | 44 | 45 | scwf:activitiReviewTask 46 | 47 | 48 | 49 | scwf:activitiReviewTask 50 | 51 | 52 | 53 | scwf:activitiReviewTask 54 | 55 | 56 | 57 | bpm:activitiOutcomeTask 58 | 59 | 60 | d:text 61 | Abort 62 | 63 | 64 | 65 | 66 | Re-submit 67 | Abort 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | edit_package_item_actions 77 | 78 | 79 | {http://www.someco.com/model/workflow/1.0}reviseOutcome 80 | 81 | 82 | 83 | 84 | 85 | bpm:activitiOutcomeTask 86 | 87 | 88 | d:text 89 | Reject 90 | 91 | 92 | 93 | 94 | Approve 95 | Reject 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | read_package_item_actions 105 | 106 | 107 | {http://www.someco.com/model/workflow/1.0}approveRejectOutcome 108 | 109 | 110 | 111 | 112 | 113 | bpm:workflowTask 114 | 115 | 116 | read_package_item_actions 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | Someco Third Party Reviewable 125 | 126 | 127 | d:text 128 | false 129 | false 130 | 131 | 132 | 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/workflows/workflowDefinitions/helloWorld.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/workflows/workflowDefinitions/helloWorldFork.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/workflows/workflowDefinitions/helloWorldUI.bpmn: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | execution.setVariable('wf_reviewOutcome', task.getVariable('wf_reviewOutcome')); 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | logger.log("The outcome of the review task is: " + wf_reviewOutcome); 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/context/dynamic-bootstrap-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | false 9 | false 10 | false 11 | false 12 | false 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/context/service-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 21 | 22 | patch.demoData.sites.description 23 | 0 24 | ${version.schema} 25 | 10000 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | patch.authorities.users.description 39 | 0 40 | ${version.schema} 41 | 10000 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | patch.authorities.groups.description 51 | 0 52 | ${version.schema} 53 | 10000 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | patch.fixRMSite 64 | patch.RMSite.description 65 | 0 66 | ${version.schema} 67 | 10000 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | patch.importDemoDataJavaScript 76 | 77 | 78 | patch.repoImport.description 79 | 80 | 81 | 0 82 | 83 | 84 | ${version.schema} 85 | 86 | 87 | 10000 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | alfresco.messages.boostrap-messages 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/context/std-bootstrap-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/log4j.properties: -------------------------------------------------------------------------------- 1 | #log4j.logger.org.alfresco.repo.dictionary.DictionaryBootstrap=TRACE 2 | #log4j.logger.org.alfresco.repo.module=DEBUG 3 | #log4j.logger.org.alfresco.repo.importer=DEBUG 4 | #log4j.logger.org.alfresco.repo.admin.patch=DEBUG 5 | 6 | log4j.logger.org.alfresco.devops=INFO 7 | #log4j.logger.org.alfresco.repo.search=TRACE 8 | #log4j.logger.org.alfresco.service.cmr.search=TRACE 9 | 10 | #log4j.logger.org.alfresco.repo.dictionary=TRACE 11 | #log4j.logger.org.alfresco.repo.admin.patch.impl.RMSiteLoadPatch2=DEBUG 12 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/module-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/amp/module.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | 18 | # SDK Sample module 19 | 20 | # ==== Beginning of Alfresco required/optional properties ====== # 21 | 22 | module.id=${project.artifactId} 23 | #module.aliases=myModule-123, my-module 24 | module.title=${project.name} 25 | module.description=${project.description} 26 | module.version=${noSnapshotVersion} 27 | 28 | # The following optional properties can be used to prevent the module from being added 29 | # to inappropriate versions of the WAR file. 30 | # module.repo.version.min=2.0 31 | # module.repo.version.max=2.1 32 | 33 | # FIXME: This dependencies should come out of mvn dependencies on amp 34 | 35 | # The following describe dependencies on other modules 36 | # Depends on net.sf.myproject.module.SupportModuleA version ${version} or later 37 | # module.depends.net.sf.myproject.module.SupportModuleA=${version}-* 38 | # Depends on net.sf.myproject.module.SupportModuleA version ${version} to 2.0 39 | # module.depends.net.sf.myproject.module.SupportModuleB=${version}-2.0 40 | # Depends on net.sf.myproject.module.SupportModuleC - any version 41 | # module.depends.net.sf.myproject.module.SupportModuleB=* 42 | #module.depends.org_alfresco_module_rm=* 43 | 44 | # ==== End of Alfresco required/optional properties ======= # 45 | 46 | 47 | # ==== Beginning of module required properties/optional ====== # -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/java/org/alfresco/devops/importers/GroupsImporterPatch.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | package org.alfresco.devops.importers; 20 | 21 | import java.io.File; 22 | import java.io.FileReader; 23 | import java.io.Serializable; 24 | import java.util.ArrayList; 25 | import java.util.HashSet; 26 | import java.util.List; 27 | import java.util.Map; 28 | import java.util.Properties; 29 | import java.util.Set; 30 | 31 | import org.alfresco.devops.util.Constants; 32 | import org.alfresco.error.AlfrescoRuntimeException; 33 | import org.alfresco.repo.admin.patch.AbstractPatch; 34 | import org.alfresco.repo.importer.ImporterBootstrap; 35 | import org.alfresco.repo.security.authentication.AuthenticationUtil; 36 | import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork; 37 | import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; 38 | import org.alfresco.service.cmr.attributes.AttributeService; 39 | import org.alfresco.service.cmr.security.AuthorityService; 40 | import org.alfresco.service.cmr.security.AuthorityType; 41 | import org.alfresco.service.cmr.security.PersonService; 42 | import org.alfresco.service.cmr.site.SiteService; 43 | import org.alfresco.service.descriptor.Descriptor; 44 | import org.alfresco.service.descriptor.DescriptorService; 45 | import org.apache.commons.logging.Log; 46 | import org.apache.commons.logging.LogFactory; 47 | import org.json.JSONException; 48 | import org.json.simple.JSONArray; 49 | import org.json.simple.JSONObject; 50 | import org.json.simple.parser.JSONParser; 51 | import org.springframework.context.ApplicationListener; 52 | import org.springframework.context.event.ContextRefreshedEvent; 53 | import org.springframework.extensions.surf.util.I18NUtil; 54 | 55 | 56 | public class GroupsImporterPatch extends AbstractPatch implements ApplicationListener{ 57 | 58 | public static final String PROPERTIES_GROUPS = "groups"; 59 | public static final String PROPERTY_LOCATION = "location"; 60 | private boolean onContextRefreshedEvent=false; 61 | private boolean updateGroups=false; 62 | private AttributeService attributeService; 63 | private static final Serializable[] IMPORTED_GROUPS = new Serializable[] {"DDImportedGroups"}; 64 | 65 | 66 | 67 | private static final String MSG_NO_BOOTSTRAP_VIEWS_GIVEN = "patch.siteLoadPatch.noBootstrapViews"; 68 | 69 | private static final Log logger = LogFactory.getLog(GroupsImporterPatch.class); 70 | 71 | private AuthorityService authorityService; 72 | private DescriptorService descriptorService; 73 | private SiteService siteService; 74 | 75 | private PersonService personService; 76 | 77 | 78 | private Map bootstrapViews; 79 | 80 | private Boolean disabled = false; 81 | 82 | public GroupsImporterPatch() 83 | { 84 | // We do need to run in our own transaction 85 | setRequiresTransaction(true); 86 | onContextRefreshedEvent=false; 87 | } 88 | 89 | 90 | /** 91 | * Sets the details of the bootstraps to perform 92 | */ 93 | public void setBootstrapViews(Map bootstrapViews) 94 | { 95 | this.bootstrapViews = bootstrapViews; 96 | } 97 | 98 | /** 99 | * Sets the Authority Service to be used for groups and people 100 | * 101 | * @param authorityService The Authority Service 102 | */ 103 | public void setAuthorityService(AuthorityService authorityService) 104 | { 105 | this.authorityService = authorityService; 106 | } 107 | 108 | /** 109 | * @param descriptorService the descriptorService to set 110 | */ 111 | public void setDescriptorService(DescriptorService descriptorService) 112 | { 113 | this.descriptorService = descriptorService; 114 | } 115 | 116 | public void setDisabled(boolean disabled) 117 | { 118 | this.disabled = disabled; 119 | } 120 | 121 | public boolean isDisabled() { 122 | return disabled; 123 | } 124 | 125 | @Override 126 | protected void checkProperties() 127 | { 128 | super.checkProperties(); 129 | } 130 | 131 | @Override 132 | protected String applyInternal() throws Exception 133 | { 134 | if(!onContextRefreshedEvent){ 135 | return "Groups will be loaded later"; 136 | } 137 | if (isDisabled()) 138 | { 139 | if (logger.isDebugEnabled()) 140 | { 141 | logger.debug("Load of groups is disabled."); 142 | } 143 | return "Load of groups is disabled."; 144 | } 145 | 146 | return applyInternalImpl(); 147 | } 148 | 149 | private String applyInternalImpl() throws Exception 150 | { 151 | Boolean importedGroups = (Boolean)attributeService.getAttribute(IMPORTED_GROUPS); 152 | if(importedGroups==null){ 153 | 154 | if(descriptorService != null) 155 | { 156 | // if the descriptor service is wired up only load at install time (and not on upgrade) 157 | Descriptor installed = descriptorService.getInstalledRepositoryDescriptor(); 158 | Descriptor live = descriptorService.getServerDescriptor(); 159 | 160 | if(!installed.getVersion().equals(live.getVersion())) 161 | { 162 | return "Groups not created."; 163 | } 164 | } 165 | 166 | if (bootstrapViews == null || bootstrapViews.size() == 0) 167 | { 168 | if (logger.isDebugEnabled()) 169 | { 170 | logger.debug("No Bootstraps given to import from - bootstrap import ignored"); 171 | } 172 | return I18NUtil.getMessage(MSG_NO_BOOTSTRAP_VIEWS_GIVEN); 173 | } 174 | 175 | try{ 176 | 177 | // Put people into groups 178 | if(bootstrapViews.containsKey(PROPERTIES_GROUPS)) 179 | { 180 | doGroupImport(bootstrapViews.get(PROPERTIES_GROUPS).getProperty(PROPERTY_LOCATION)); 181 | attributeService.setAttribute(Boolean.TRUE, IMPORTED_GROUPS); 182 | } 183 | } 184 | catch(AlfrescoRuntimeException ine){ 185 | logger.warn("this patch might have already run -- continue -- set DEBUG on org.alfresco.repo.admin.patch if it's not the case"); 186 | } 187 | 188 | return "Groups loaded"; 189 | } 190 | return "Groups already loaded"; 191 | } 192 | 193 | @SuppressWarnings("unchecked") 194 | private void doGroupImport(String location) 195 | { 196 | logger.info("[DEMO-DATA] Importing Groups"); 197 | File groupFile = ImporterBootstrap.getFile(location); 198 | JSONParser parser = new JSONParser(); 199 | try{ 200 | Object obj = parser.parse(new FileReader(groupFile)); 201 | JSONArray groups = (JSONArray)obj; 202 | JSONArray includedGroups = new JSONArray(); 203 | 204 | List includedGroupsName = new ArrayList(); 205 | for (int i = 0; i < groups.size(); i++) { 206 | JSONObject group = (JSONObject) groups.get(i); 207 | if(includeGroup(group)){ 208 | 209 | createOrUpdateRootGroup(group); 210 | includedGroups.add(group); 211 | includedGroupsName.add((String)group.get(Constants.GROUP_NAME)); 212 | } 213 | } 214 | //add subgroups for included groups 215 | for (int i = 0; i < includedGroups.size(); i++) { 216 | JSONObject group = (JSONObject) includedGroups.get(i); 217 | associateSubGroups(group,includedGroupsName); 218 | } 219 | } 220 | 221 | catch (Exception e) { 222 | logger.error("Group-Import failed:",e); 223 | } 224 | } 225 | 226 | private boolean includeGroup(JSONObject group){ 227 | String name = (String) group.get(Constants.GROUP_NAME); 228 | //is it a site group? 229 | if(name.startsWith(Constants.GROUP_SITE)){ 230 | String siteName = siteService.resolveSite(name); 231 | //don't include the site group if the site does not exist in the repo 232 | if(siteService.getSite(siteName)==null){ 233 | return false; 234 | } 235 | } 236 | return true; 237 | } 238 | 239 | 240 | private void createOrUpdateRootGroup(JSONObject group) throws JSONException { 241 | String name = (String) group.get(Constants.GROUP_NAME); 242 | 243 | String displayName = (String) group.get(Constants.GROUP_DISPLAYNAME) != null ? (String) group.get(Constants.GROUP_DISPLAYNAME) : name; 244 | JSONArray zones = (JSONArray) group.get(Constants.GROUP_ZONES); 245 | JSONArray members = (JSONArray) group.get(Constants.GROUP_MEMBERS); 246 | 247 | Set zonesList = getStringSetFromJArray(zones); 248 | Set membersList = getStringSetFromJArray(members); 249 | 250 | 251 | if(!authorityService.authorityExists(name)){ 252 | // remove 'GROUP_' 253 | String replacename = name.substring(6); 254 | 255 | logger.debug("Creating authority: "+replacename); 256 | authorityService.createAuthority(AuthorityType.GROUP, replacename, displayName, zonesList); 257 | }else{ 258 | if(updateGroups){ 259 | logger.debug("Updating authority: "+name); 260 | Set zonesToAdd = new HashSet(); 261 | Set existingZones = authorityService.getAuthorityZones(name); 262 | 263 | for(String currentZone:zonesList){ 264 | if(!existingZones.contains(currentZone)){ 265 | zonesToAdd.add(currentZone); 266 | } 267 | } 268 | if(!zonesToAdd.isEmpty()){ 269 | //updating zones if necessary 270 | authorityService.addAuthorityToZones(name, zonesToAdd); 271 | } 272 | //updating displayname 273 | authorityService.setAuthorityDisplayName(name, displayName); 274 | } 275 | } 276 | 277 | Set containedUsers = authorityService.getContainedAuthorities(AuthorityType.USER, name, true); 278 | 279 | 280 | for(String member:membersList){ 281 | if(!personService.personExists(member)){ 282 | logger.warn("Member "+member+" does not exist in the repo - cannot be added to group "+name); 283 | } 284 | else if(!containedUsers.contains(member)){ 285 | //add authority if not there already and if exists 286 | authorityService.addAuthority(name, member); 287 | } 288 | } 289 | 290 | } 291 | 292 | 293 | private void associateSubGroups(JSONObject group,List includedGroupsName) throws JSONException { 294 | String name = (String) group.get(Constants.GROUP_NAME); 295 | JSONArray subgroups = (JSONArray) group.get(Constants.GROUP_SUBGROUPS); 296 | 297 | Set subgroupsList = getStringSetFromJArray(subgroups); 298 | 299 | Set containedGroups = authorityService.getContainedAuthorities(AuthorityType.GROUP, name, true); 300 | 301 | for(String subGroup:subgroupsList){ 302 | //create or update subgroup 303 | if(subGroup!= null && !containedGroups.contains(subGroup) && includedGroupsName.contains(subGroup)){ 304 | //adding authority 305 | authorityService.addAuthority(name, subGroup); 306 | } 307 | } 308 | 309 | } 310 | 311 | 312 | private Set getStringSetFromJArray(JSONArray zones) { 313 | Set zonesList = new HashSet(); 314 | if (zones != null) { 315 | int len = zones.size(); 316 | for (int j=0;j(){ 338 | @Override 339 | public Void doWork() throws Exception 340 | { 341 | try { 342 | RetryingTransactionCallback txnWork = new RetryingTransactionCallback(){ 343 | public String execute() throws Exception 344 | { 345 | return applyInternal(); 346 | } 347 | }; 348 | transactionService.getRetryingTransactionHelper().doInTransaction(txnWork, false); 349 | } catch (Exception e) { 350 | logger.error("-- Error bootstrapping --",e); 351 | } 352 | return null; 353 | } 354 | }); 355 | 356 | } 357 | 358 | 359 | 360 | public void setSiteService(SiteService siteService) { 361 | this.siteService = siteService; 362 | } 363 | 364 | 365 | public void setUpdateGroups(boolean updateGroups) { 366 | this.updateGroups = updateGroups; 367 | } 368 | 369 | 370 | public void setAttributeService(AttributeService attributeService) { 371 | this.attributeService = attributeService; 372 | } 373 | 374 | 375 | 376 | 377 | } 378 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/java/org/alfresco/devops/importers/PostSiteLoadPatch.java: -------------------------------------------------------------------------------- 1 | package org.alfresco.devops.importers; 2 | 3 | import java.io.Serializable; 4 | import java.util.ArrayList; 5 | import java.util.List; 6 | 7 | import org.alfresco.model.ContentModel; 8 | import org.alfresco.repo.admin.patch.impl.SiteLoadPatch; 9 | import org.alfresco.repo.policy.BehaviourFilter; 10 | import org.alfresco.repo.security.authentication.AuthenticationUtil; 11 | import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork; 12 | import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; 13 | import org.alfresco.service.cmr.attributes.AttributeService; 14 | import org.apache.commons.logging.Log; 15 | import org.apache.commons.logging.LogFactory; 16 | import org.springframework.context.ApplicationListener; 17 | import org.springframework.context.event.ContextRefreshedEvent; 18 | 19 | public class PostSiteLoadPatch extends SiteLoadPatch implements ApplicationListener{ 20 | 21 | private boolean onContextRefreshedEvent=false; 22 | private static final Log logger = LogFactory.getLog(PostSiteLoadPatch.class); 23 | private String siteName; 24 | private AttributeService attributeService; 25 | private static final Serializable[] IMPORTED_SITES = new Serializable[] {"DDImportedSites"}; 26 | private BehaviourFilter behaviourFilter; 27 | 28 | 29 | 30 | public PostSiteLoadPatch() { 31 | super(); 32 | onContextRefreshedEvent=false; 33 | } 34 | 35 | 36 | @Override 37 | protected String applyInternal() throws Exception 38 | { 39 | if(onContextRefreshedEvent){ 40 | ArrayList sites = (ArrayList) attributeService.getAttribute(IMPORTED_SITES); 41 | if(sites==null){ 42 | sites = new ArrayList(); 43 | } 44 | if(!sites.contains(siteName)){ 45 | logger.info("[DEMO-DATA] Importing Site "+siteName); 46 | String message = super.applyInternal(); 47 | sites.add(siteName); 48 | attributeService.setAttribute(sites, IMPORTED_SITES); 49 | return message; 50 | }else{ 51 | return "Site "+siteName+" already installed"; 52 | } 53 | } 54 | else{ 55 | return "This patch will be applied at Spring ContextRefreshedEvent"; 56 | } 57 | } 58 | 59 | 60 | @Override 61 | public void onApplicationEvent(ContextRefreshedEvent event) { 62 | onContextRefreshedEvent=true; 63 | AuthenticationUtil.runAsSystem(new RunAsWork(){ 64 | @Override 65 | public Void doWork() throws Exception 66 | { 67 | try { 68 | RetryingTransactionCallback txnWork = new RetryingTransactionCallback(){ 69 | public String execute() throws Exception 70 | { 71 | behaviourFilter.disableBehaviour(ContentModel.ASPECT_AUDITABLE); 72 | String message = applyInternal(); 73 | behaviourFilter.enableBehaviour(ContentModel.ASPECT_AUDITABLE); 74 | return message; 75 | } 76 | }; 77 | transactionService.getRetryingTransactionHelper().doInTransaction(txnWork, false,false); 78 | } catch (Exception e) { 79 | // TODO Auto-generated catch block 80 | logger.error("[DEMO-DATA] Error bootstrapping Site "+siteName,e); 81 | } 82 | return null; 83 | } 84 | }); 85 | 86 | } 87 | 88 | 89 | 90 | public void setSiteName(String siteName) 91 | { 92 | this.siteName=siteName; 93 | super.setSiteName(siteName); 94 | } 95 | 96 | 97 | public void setAttributeService(AttributeService attributeService) { 98 | this.attributeService = attributeService; 99 | } 100 | 101 | 102 | public void setBehaviourFilter(BehaviourFilter behaviourFilter) { 103 | this.behaviourFilter = behaviourFilter; 104 | super.setBehaviourFilter(behaviourFilter); 105 | } 106 | 107 | 108 | } 109 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/java/org/alfresco/devops/importers/RMSitePatch.java: -------------------------------------------------------------------------------- 1 | package org.alfresco.devops.importers; 2 | 3 | import java.io.Serializable; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | 7 | import org.alfresco.repo.admin.patch.AbstractPatch; 8 | import org.alfresco.repo.security.authentication.AuthenticationUtil; 9 | import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork; 10 | import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback; 11 | import org.alfresco.service.cmr.attributes.AttributeService; 12 | import org.alfresco.service.cmr.repository.NodeRef; 13 | import org.alfresco.service.cmr.repository.StoreRef; 14 | import org.alfresco.service.cmr.search.ResultSet; 15 | import org.alfresco.service.cmr.search.SearchParameters; 16 | import org.alfresco.service.cmr.search.SearchService; 17 | import org.alfresco.service.namespace.QName; 18 | import org.apache.commons.logging.Log; 19 | import org.apache.commons.logging.LogFactory; 20 | import org.springframework.context.ApplicationListener; 21 | import org.springframework.context.event.ContextRefreshedEvent; 22 | 23 | public class RMSitePatch extends AbstractPatch implements ApplicationListener{ 24 | 25 | private static final Log logger = LogFactory.getLog(RMSitePatch.class); 26 | private boolean onContextRefreshedEvent=false; 27 | private AttributeService attributeService; 28 | private static final Serializable[] RM_PATCH_APPLIED = new Serializable[] {"RMPatchApplied"}; 29 | public static final QName PROP_READERS = QName.createQName("http://www.alfresco.org/model/recordsmanagement/1.0", "readers"); 30 | public static final QName PROP_WRITERS = QName.createQName("http://www.alfresco.org/model/recordsmanagement/1.0", "writers"); 31 | 32 | 33 | public RMSitePatch() 34 | { 35 | onContextRefreshedEvent=false; 36 | } 37 | 38 | @Override 39 | protected String applyInternal() throws Exception { 40 | 41 | if(!onContextRefreshedEvent){ 42 | return "This patch will be applied at Spring ContextRefreshedEvent"; 43 | } 44 | 45 | Boolean importedSites = (Boolean)attributeService.getAttribute(RM_PATCH_APPLIED); 46 | if(importedSites==null){ 47 | 48 | ResultSet rs=null; 49 | try{ 50 | logger.info("[DEMO-DATA] RM Site Patch"); 51 | SearchParameters sp = new SearchParameters(); 52 | sp.addStore(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE); 53 | sp.setLanguage(SearchService.LANGUAGE_FTS_ALFRESCO); 54 | 55 | sp.setQuery("ASPECT:\"rma:extendedSecurity\""); 56 | rs = searchService.query(sp); 57 | 58 | for(NodeRef nr : rs.getNodeRefs()){ 59 | Serializable serPropReaders = nodeService.getProperty(nr, PROP_READERS); 60 | Serializable serPropWriters = nodeService.getProperty(nr, PROP_WRITERS); 61 | 62 | if(serPropReaders instanceof String){ 63 | Map map = getMapFromString(serPropReaders); 64 | nodeService.setProperty(nr, PROP_READERS,(Serializable)map); 65 | } 66 | 67 | if(serPropWriters instanceof String){ 68 | Map map = getMapFromString(serPropWriters); 69 | nodeService.setProperty(nr, PROP_WRITERS,(Serializable)map); 70 | } 71 | } 72 | attributeService.setAttribute(Boolean.TRUE, RM_PATCH_APPLIED); 73 | 74 | } 75 | finally 76 | { 77 | if (rs != null) 78 | { 79 | rs.close(); 80 | } 81 | } 82 | return "RM Fix Patch applied"; 83 | 84 | } 85 | return "RM Fix Patch already applied"; 86 | 87 | 88 | 89 | } 90 | 91 | private Map getMapFromString(Serializable prop) { 92 | String stringProp = (String)prop; 93 | 94 | //remove the brackets 95 | if(stringProp.startsWith("{") && stringProp.endsWith("}")){ 96 | stringProp = stringProp.substring(1, stringProp.length()-1); 97 | } 98 | 99 | String[] csProp = stringProp.split(","); 100 | 101 | Map map = new HashMap(); 102 | for(String s : csProp){ 103 | String[] el = s.split("="); 104 | if(el.length==2){ 105 | try{ 106 | map.put(el[0].trim(), Integer.parseInt(el[1].trim())); 107 | }catch(NumberFormatException nfe){ 108 | logger.error(el[1]+" is not a valid number"); 109 | } 110 | } 111 | } 112 | return map; 113 | } 114 | 115 | 116 | 117 | @Override 118 | public void onApplicationEvent(ContextRefreshedEvent event) { 119 | onContextRefreshedEvent=true; 120 | 121 | AuthenticationUtil.runAsSystem(new RunAsWork(){ 122 | @Override 123 | public Void doWork() throws Exception 124 | { 125 | try{ 126 | RetryingTransactionCallback txnWork = new RetryingTransactionCallback(){ 127 | public String execute() throws Exception 128 | { 129 | return applyInternal(); 130 | } 131 | }; 132 | transactionService.getRetryingTransactionHelper().doInTransaction(txnWork, false); 133 | }catch(Exception ex){ 134 | logger.error("-- Error applying RM Patch --",ex); 135 | } 136 | return null; 137 | } 138 | }); 139 | } 140 | 141 | public void setAttributeService(AttributeService attributeService) { 142 | this.attributeService = attributeService; 143 | } 144 | 145 | } 146 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/java/org/alfresco/devops/importers/UsersImporterPatch.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2005-2010 Alfresco Software Limited. 3 | * 4 | * This file is part of Alfresco 5 | * 6 | * Alfresco is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * Alfresco is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with Alfresco. If not, see . 18 | */ 19 | package org.alfresco.devops.importers; 20 | 21 | import java.io.Serializable; 22 | import java.util.ArrayList; 23 | import java.util.HashMap; 24 | import java.util.List; 25 | import java.util.Map; 26 | import java.util.Properties; 27 | 28 | import org.alfresco.error.AlfrescoRuntimeException; 29 | import org.alfresco.repo.admin.patch.AbstractPatch; 30 | import org.alfresco.repo.importer.ImporterBootstrap; 31 | import org.alfresco.service.cmr.attributes.AttributeService; 32 | import org.alfresco.service.cmr.view.ImporterBinding.UUID_BINDING; 33 | import org.alfresco.service.descriptor.Descriptor; 34 | import org.alfresco.service.descriptor.DescriptorService; 35 | import org.apache.commons.logging.Log; 36 | import org.apache.commons.logging.LogFactory; 37 | import org.springframework.extensions.surf.util.I18NUtil; 38 | 39 | 40 | public class UsersImporterPatch extends AbstractPatch{ 41 | 42 | public static final String PROPERTIES_USERS = "users"; 43 | public static final String PROPERTIES_PEOPLE = "people"; 44 | public static final String PROPERTY_LOCATION = "location"; 45 | 46 | private AttributeService attributeService; 47 | private static final Serializable[] IMPORTED_USERS = new Serializable[] {"DDImportedUsers"}; 48 | 49 | private static final Map DEFAULT_PATHS = new HashMap(); 50 | static { 51 | DEFAULT_PATHS.put(PROPERTIES_USERS, "/${alfresco_user_store.system_container.childname}/${alfresco_user_store.user_container.childname}"); 52 | DEFAULT_PATHS.put(PROPERTIES_PEOPLE, "/${system.system_container.childname}/${system.people_container.childname}"); 53 | } 54 | 55 | private static final String MSG_NO_BOOTSTRAP_VIEWS_GIVEN = "patch.siteLoadPatch.noBootstrapViews"; 56 | 57 | private static final Log logger = LogFactory.getLog(UsersImporterPatch.class); 58 | 59 | private DescriptorService descriptorService; 60 | 61 | private ImporterBootstrap spacesBootstrap; 62 | private ImporterBootstrap usersBootstrap; 63 | 64 | 65 | private Map bootstrapViews; 66 | 67 | private Boolean disabled = false; 68 | 69 | public UsersImporterPatch() 70 | { 71 | // We do need to run in our own transaction 72 | setRequiresTransaction(true); 73 | } 74 | 75 | 76 | public void setSpacesBootstrap(ImporterBootstrap spacesBootstrap) 77 | { 78 | this.spacesBootstrap = spacesBootstrap; 79 | } 80 | public void setUsersBootstrap(ImporterBootstrap usersBootstrap) 81 | { 82 | this.usersBootstrap = usersBootstrap; 83 | } 84 | 85 | /** 86 | * Sets the details of the bootstraps to perform 87 | */ 88 | public void setBootstrapViews(Map bootstrapViews) 89 | { 90 | this.bootstrapViews = bootstrapViews; 91 | } 92 | 93 | 94 | /** 95 | * @param descriptorService the descriptorService to set 96 | */ 97 | public void setDescriptorService(DescriptorService descriptorService) 98 | { 99 | this.descriptorService = descriptorService; 100 | } 101 | 102 | public void setDisabled(boolean disabled) 103 | { 104 | this.disabled = disabled; 105 | } 106 | 107 | public boolean isDisabled() { 108 | return disabled; 109 | } 110 | 111 | @Override 112 | protected void checkProperties() 113 | { 114 | super.checkProperties(); 115 | } 116 | 117 | @Override 118 | protected String applyInternal() throws Exception 119 | { 120 | if (isDisabled()) 121 | { 122 | if (logger.isDebugEnabled()) 123 | { 124 | logger.debug("Load of users is disabled."); 125 | } 126 | return "Load of users is disabled."; 127 | } 128 | 129 | return applyInternalImpl(); 130 | } 131 | 132 | private String applyInternalImpl() throws Exception 133 | { 134 | 135 | Boolean importedUsers = (Boolean)attributeService.getAttribute(IMPORTED_USERS); 136 | if(importedUsers==null || importedUsers.booleanValue()==false){ 137 | 138 | 139 | if(descriptorService != null) 140 | { 141 | // if the descriptor service is wired up only load at install time (and not on upgrade) 142 | Descriptor installed = descriptorService.getInstalledRepositoryDescriptor(); 143 | Descriptor live = descriptorService.getServerDescriptor(); 144 | 145 | if(!installed.getVersion().equals(live.getVersion())) 146 | { 147 | return "Users not created."; 148 | } 149 | } 150 | 151 | if (bootstrapViews == null || bootstrapViews.size() == 0) 152 | { 153 | if (logger.isDebugEnabled()) 154 | { 155 | logger.debug("No Bootstraps given to import from - bootstrap import ignored"); 156 | } 157 | return I18NUtil.getMessage(MSG_NO_BOOTSTRAP_VIEWS_GIVEN); 158 | } 159 | 160 | logger.info("[DEMO-DATA] Importing Users"); 161 | 162 | // Setup the Importer Bootstrap Beans 163 | for(ImporterBootstrap bootstrap : new ImporterBootstrap[] { spacesBootstrap, usersBootstrap }) 164 | { 165 | bootstrap.setAllowWrite(true); 166 | bootstrap.setUseExistingStore(true); 167 | bootstrap.setUuidBinding(UUID_BINDING.REPLACE_EXISTING); 168 | } 169 | 170 | for(String type : DEFAULT_PATHS.keySet()) 171 | { 172 | Properties props = bootstrapViews.get(type); 173 | if(props != null && DEFAULT_PATHS.get(type) != null) 174 | { 175 | if(!props.containsKey("path")) 176 | { 177 | props.setProperty("path", DEFAULT_PATHS.get(type)); 178 | } 179 | } 180 | } 181 | 182 | try{ 183 | if(bootstrapViews.containsKey(PROPERTIES_USERS)) 184 | { 185 | List views = new ArrayList(1); 186 | views.add(bootstrapViews.get(PROPERTIES_USERS)); 187 | usersBootstrap.setBootstrapViews(views); 188 | usersBootstrap.bootstrap(); 189 | 190 | } 191 | 192 | if(bootstrapViews.containsKey(PROPERTIES_PEOPLE)) 193 | { 194 | List views = new ArrayList(1); 195 | views.add(bootstrapViews.get(PROPERTIES_PEOPLE)); 196 | spacesBootstrap.setBootstrapViews(views); 197 | spacesBootstrap.bootstrap(); 198 | } 199 | attributeService.setAttribute(Boolean.TRUE, IMPORTED_USERS); 200 | } 201 | catch(AlfrescoRuntimeException ine){ 202 | logger.warn("this patch might have already run -- continue -- set DEBUG on org.alfresco.repo.admin.patch if it's not the case",ine); 203 | } 204 | 205 | return "Users loaded"; 206 | } 207 | return "Users already imported"; 208 | 209 | } 210 | 211 | 212 | public void setAttributeService(AttributeService attributeService) { 213 | this.attributeService = attributeService; 214 | } 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | } 227 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/java/org/alfresco/devops/services/DynamicBootstrapPatchPostProcessor.java: -------------------------------------------------------------------------------- 1 | package org.alfresco.devops.services; 2 | 3 | import java.io.IOException; 4 | import java.nio.file.Path; 5 | import java.nio.file.Paths; 6 | import java.util.ArrayList; 7 | import java.util.HashMap; 8 | import java.util.HashSet; 9 | import java.util.List; 10 | import java.util.Map; 11 | import java.util.Properties; 12 | import java.util.Set; 13 | import java.util.regex.Matcher; 14 | import java.util.regex.Pattern; 15 | 16 | import org.alfresco.devops.importers.GroupsImporterPatch; 17 | import org.alfresco.devops.importers.PostSiteLoadPatch; 18 | import org.alfresco.devops.importers.RMSitePatch; 19 | import org.alfresco.devops.importers.UsersImporterPatch; 20 | import org.alfresco.devops.util.Constants; 21 | import org.alfresco.repo.admin.patch.impl.GenericBootstrapPatch; 22 | import org.apache.commons.logging.Log; 23 | import org.apache.commons.logging.LogFactory; 24 | import org.springframework.beans.BeansException; 25 | import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; 26 | import org.springframework.beans.factory.support.BeanDefinitionBuilder; 27 | import org.springframework.beans.factory.support.BeanDefinitionRegistry; 28 | import org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor; 29 | 30 | public class DynamicBootstrapPatchPostProcessor implements BeanDefinitionRegistryPostProcessor { 31 | 32 | private ResourcesResolver resourcesResolver; 33 | 34 | private Boolean sitesDisabled = false; 35 | private Boolean authoritiesDisabled = false; 36 | private Boolean rmFixDisabled = true; 37 | private Boolean modelsDisabled = false; 38 | private Boolean repoDisabled = false; 39 | private Boolean wfDisabled = false; 40 | private Boolean updateGroups=false; 41 | 42 | private String sitesContentLocation; 43 | private String usersLocation; 44 | private String peopleLocation; 45 | private String groupsLocation; 46 | private String modelsXmlLocation; 47 | private String modelsLabelsLocation; 48 | private String repoLocation; 49 | private String wfDefinitionsLocation; 50 | private String wfModelsLocation; 51 | private String wfLabelsLocation; 52 | 53 | private static final String LABEL_PATTERN="_[a-zA-Z]{2}$"; 54 | 55 | 56 | private static Log logger = LogFactory.getLog(DynamicBootstrapPatchPostProcessor.class); 57 | 58 | 59 | 60 | @Override 61 | public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry registry) throws BeansException { 62 | 63 | if(!repoDisabled){ 64 | Set reposFiles = resourcesResolver.resolveResourcesFromAMP(repoLocation); 65 | 66 | if(!reposFiles.isEmpty()){ 67 | int index = repoLocation.indexOf("*"); 68 | if(index>0){ 69 | String location = repoLocation.substring(0, index); 70 | for(String fileLocation:reposFiles){ 71 | String repoPath = fileLocation.substring(location.length()); 72 | Path p = Paths.get(repoPath); 73 | if(p!=null){ 74 | Path fileNamePath = p.getFileName(); 75 | if(fileNamePath!=null){ 76 | String fileName= fileNamePath.toString(); 77 | String path = repoPath.substring(0,repoPath.length()-fileName.length()); 78 | if (!path.startsWith("/")){ 79 | path = "/"+ path; 80 | } 81 | if (path.endsWith("/")){ 82 | path = path.substring(0,path.length()-1); 83 | } 84 | String linearPath = repoPath.replaceAll("[./:-]","_"); 85 | String beanId = linearPath; 86 | BeanDefinitionBuilder beanDefinition = getRepoBeanDefinition(path,fileLocation,beanId); 87 | registry.registerBeanDefinition(beanId, beanDefinition.getBeanDefinition() ); 88 | } 89 | } 90 | } 91 | } 92 | } 93 | } 94 | 95 | 96 | if(!modelsDisabled){ 97 | Set modelsXml = resourcesResolver.resolveResourcesFromAMP(modelsXmlLocation); 98 | Set modelsLabels = resourcesResolver.resolveResourcesFromAMP(modelsLabelsLocation); 99 | 100 | if(!modelsXml.isEmpty()){ 101 | List models = new ArrayList(); 102 | List labels = new ArrayList(); 103 | models.addAll(modelsXml); 104 | Set labelSet = extractValidLabels(modelsLabels); 105 | labels.addAll(labelSet); 106 | 107 | 108 | BeanDefinitionBuilder beanDefinition = getModelBeanDefinition(models, labels); 109 | registry.registerBeanDefinition("demodata_models_dictionaryBootstrap", beanDefinition.getBeanDefinition() ); 110 | } 111 | } 112 | 113 | if(!wfDisabled){ 114 | Set definitionsSet = resourcesResolver.resolveResourcesFromAMP(wfDefinitionsLocation); 115 | Set labelsSet = resourcesResolver.resolveResourcesFromAMP(wfLabelsLocation); 116 | Set modelsSet = resourcesResolver.resolveResourcesFromAMP(wfModelsLocation); 117 | 118 | if(!definitionsSet.isEmpty()){ 119 | List models = new ArrayList(); 120 | List labels = new ArrayList(); 121 | List definitions = new ArrayList(); 122 | 123 | models.addAll(modelsSet); 124 | definitions.addAll(definitionsSet); 125 | 126 | Set labelSet = extractValidLabels(labelsSet); 127 | labels.addAll(labelSet); 128 | 129 | BeanDefinitionBuilder beanDefinition = getWorkflowBeanDefinition(definitions,models, labels); 130 | registry.registerBeanDefinition("demodata_wfss_dictionaryBootstrap", beanDefinition.getBeanDefinition() ); 131 | } 132 | } 133 | 134 | if(!sitesDisabled){ 135 | Set acps = resourcesResolver.resolveResourcesFromAMP(sitesContentLocation); 136 | for(String acp:acps){ 137 | String siteName = getSiteNameFromAcp(acp); 138 | boolean isRM = siteName.equalsIgnoreCase("RM"); 139 | 140 | if(isRM){ 141 | rmFixDisabled=false; 142 | } 143 | if(!siteName.isEmpty() ){ 144 | BeanDefinitionBuilder beanDefinition = getSiteBeanDefinition(acp, siteName); 145 | registry.registerBeanDefinition(Constants.SITES_BEAN_ID+siteName, beanDefinition.getBeanDefinition() ); 146 | } 147 | } 148 | } 149 | 150 | if(!rmFixDisabled){ 151 | registry.registerBeanDefinition(Constants.RM_FIX_BEAN_ID, getRMSiteFixBeanDefinition().getBeanDefinition()); 152 | } 153 | 154 | if(!authoritiesDisabled){ 155 | BeanDefinitionBuilder users = getUsersBeanDefinition(); 156 | BeanDefinitionBuilder groups = getGroupsBeanDefinition(); 157 | if(users!=null){ 158 | registry.registerBeanDefinition(Constants.USERS_BEAN_ID, users.getBeanDefinition() ); 159 | } 160 | if(groups!=null){ 161 | registry.registerBeanDefinition(Constants.GROUPS_BEAN_ID, groups.getBeanDefinition() ); 162 | } 163 | } 164 | 165 | } 166 | 167 | private Set extractValidLabels(Set labelsSet) { 168 | Set labelSet= new HashSet(); 169 | 170 | for(String ml:labelsSet){ 171 | //labels don't have the property extension 172 | ml = ml.substring(0,ml.lastIndexOf(".properties")); 173 | //if there is a locale in the property it needs to be removed 174 | Pattern r = Pattern.compile(LABEL_PATTERN); 175 | Matcher m = r.matcher(ml); 176 | if(m.find()){ 177 | ml = ml.substring(0,ml.indexOf("_")); 178 | labelSet.add(ml); 179 | } 180 | } 181 | return labelSet; 182 | } 183 | 184 | private String getSiteNameFromAcp(String acp) { 185 | String siteName = ""; 186 | String[] split = acp.split("/"); 187 | if(split.length>2){ 188 | siteName = split[split.length-2]; 189 | } 190 | return siteName; 191 | } 192 | 193 | private BeanDefinitionBuilder getUsersBeanDefinition() { 194 | 195 | Map bootstrapViews = new HashMap(); 196 | 197 | try { 198 | if(resourcesResolver.existsResource(usersLocation)){ 199 | Properties users = new Properties(); 200 | users.setProperty(Constants.LOCATION, usersLocation); 201 | bootstrapViews.put(Constants.USERS, users); 202 | } 203 | 204 | if(resourcesResolver.existsResource(peopleLocation)){ 205 | Properties people = new Properties(); 206 | people.setProperty(Constants.LOCATION, peopleLocation); 207 | bootstrapViews.put(Constants.PEOPLE, people); 208 | } 209 | }catch(IOException ex){ 210 | logger.error("One or more authorities resources (acp/json) could not be found"); 211 | } 212 | 213 | if(!bootstrapViews.isEmpty()){ 214 | BeanDefinitionBuilder beanDefinition = BeanDefinitionBuilder.genericBeanDefinition(UsersImporterPatch.class); 215 | beanDefinition.setParentName(Constants.USERS_PARENT_BEAN); 216 | beanDefinition.addPropertyValue(Constants.ID, Constants.USERS_PATCH_ID); 217 | beanDefinition.addPropertyValue(Constants.DISABLED, authoritiesDisabled); 218 | beanDefinition.addPropertyValue(Constants.BOOTSTRAPVIEWS, bootstrapViews); 219 | return beanDefinition; 220 | } 221 | else{ 222 | return null; 223 | } 224 | } 225 | 226 | private BeanDefinitionBuilder getGroupsBeanDefinition() { 227 | 228 | Map bootstrapViews = new HashMap(); 229 | 230 | try { 231 | if(resourcesResolver.existsResource(groupsLocation)){ 232 | Properties groups = new Properties(); 233 | groups.setProperty(Constants.LOCATION, groupsLocation); 234 | bootstrapViews.put(Constants.GROUPS, groups); 235 | } 236 | }catch(IOException ex){ 237 | logger.error("One or more authorities resources (acp/json) could not be found"); 238 | } 239 | 240 | if(!bootstrapViews.isEmpty()){ 241 | BeanDefinitionBuilder beanDefinition = BeanDefinitionBuilder.genericBeanDefinition(GroupsImporterPatch.class); 242 | beanDefinition.setParentName(Constants.GROUPS_PARENT_BEAN); 243 | beanDefinition.addPropertyValue(Constants.ID, Constants.GROUPS_PATCH_ID); 244 | beanDefinition.addPropertyValue(Constants.DISABLED, authoritiesDisabled); 245 | beanDefinition.addPropertyValue(Constants.BOOTSTRAPVIEWS, bootstrapViews); 246 | beanDefinition.addPropertyValue("updateGroups", updateGroups); 247 | return beanDefinition; 248 | } 249 | else{ 250 | return null; 251 | } 252 | } 253 | 254 | private BeanDefinitionBuilder getModelBeanDefinition(List models,List labels) { 255 | BeanDefinitionBuilder beanDefinition = BeanDefinitionBuilder.genericBeanDefinition(); 256 | beanDefinition.setParentName(Constants.DICTIONARY_MODEL_BOOTSTRAP); 257 | beanDefinition.addDependsOn(Constants.DICTIONARY_BOOTSTRAP); 258 | beanDefinition.addPropertyValue(Constants.MODELS, models); 259 | if(labels.size()>0){ 260 | beanDefinition.addPropertyValue(Constants.LABELS, labels); 261 | } 262 | return beanDefinition; 263 | } 264 | 265 | private BeanDefinitionBuilder getWorkflowBeanDefinition(List definitions,List models,List labels) { 266 | 267 | BeanDefinitionBuilder beanDefinition = BeanDefinitionBuilder.genericBeanDefinition(); 268 | beanDefinition.setParentName(Constants.WORKFLOW_DEPLOYER); 269 | List props = new ArrayList(); 270 | for(String definition:definitions){ 271 | Properties p = new Properties(); 272 | p.setProperty(Constants.ENGINE_ID, Constants.ACTIVITI); 273 | p.setProperty(Constants.LOCATION, definition); 274 | p.setProperty(Constants.MIMETYPE, "text/xml"); 275 | p.setProperty(Constants.MIMETYPE, "false"); 276 | props.add(p); 277 | } 278 | beanDefinition.addPropertyValue(Constants.WORKFLOW_DEFINITIONS, props); 279 | if(!models.isEmpty()){ 280 | beanDefinition.addPropertyValue(Constants.MODELS, models); 281 | } 282 | if(!labels.isEmpty()){ 283 | beanDefinition.addPropertyValue(Constants.LABELS, labels); 284 | } 285 | return beanDefinition; 286 | } 287 | 288 | private BeanDefinitionBuilder getRepoBeanDefinition(String path,String fileLocation, String id) { 289 | 290 | BeanDefinitionBuilder beanDefinition = BeanDefinitionBuilder.genericBeanDefinition(GenericBootstrapPatch.class); 291 | beanDefinition.setParentName(Constants.DEMODATA_REPO_PARENT_BEAN); 292 | 293 | beanDefinition.addPropertyValue(Constants.ID, id); 294 | 295 | Properties p = new Properties(); 296 | p.setProperty(Constants.LOCATION, fileLocation); 297 | p.setProperty(Constants.PATH, path); 298 | p.setProperty(Constants.UUIDBINDING, Constants.REPLACE_EXISTING); 299 | 300 | beanDefinition.addPropertyValue(Constants.BOOTSTRAPVIEW, p); 301 | return beanDefinition; 302 | } 303 | 304 | 305 | private BeanDefinitionBuilder getSiteBeanDefinition(String acp,String siteName) { 306 | BeanDefinitionBuilder beanDefinition = BeanDefinitionBuilder.genericBeanDefinition(PostSiteLoadPatch.class); 307 | beanDefinition.setParentName(Constants.SITES_PARENT_BEAN); 308 | beanDefinition.addPropertyValue(Constants.ID, Constants.SITES_PATCH_ID+siteName); 309 | beanDefinition.addPropertyValue(Constants.DISABLED, false); 310 | beanDefinition.addPropertyValue(Constants.SITENAME, siteName); 311 | Map bootstrapViews = new HashMap(); 312 | Properties p = new Properties(); 313 | p.setProperty(Constants.LOCATION, acp); 314 | bootstrapViews.put(Constants.CONTENTS, p); 315 | beanDefinition.addPropertyValue(Constants.BOOTSTRAPVIEWS, bootstrapViews); 316 | return beanDefinition; 317 | } 318 | 319 | private BeanDefinitionBuilder getRMSiteFixBeanDefinition() { 320 | BeanDefinitionBuilder beanDefinition = BeanDefinitionBuilder.genericBeanDefinition(RMSitePatch.class); 321 | beanDefinition.setParentName(Constants.RM_FIX_PARENT_BEAN); 322 | return beanDefinition; 323 | } 324 | 325 | @Override 326 | public void postProcessBeanFactory( 327 | ConfigurableListableBeanFactory beanFactory) throws BeansException { 328 | //do nothing 329 | } 330 | 331 | public void setResourcesResolver(ResourcesResolver resourcesResolver) { 332 | this.resourcesResolver = resourcesResolver; 333 | } 334 | 335 | 336 | public void setSitesDisabled(boolean sitesDisabled) 337 | { 338 | this.sitesDisabled = sitesDisabled; 339 | } 340 | 341 | public boolean isSitesDisabled() { 342 | return sitesDisabled; 343 | } 344 | 345 | 346 | public void setSitesContentLocation(String sitesContentLocation) { 347 | this.sitesContentLocation = sitesContentLocation; 348 | } 349 | 350 | public void setSitesDisabled(Boolean sitesDisabled) { 351 | this.sitesDisabled = sitesDisabled; 352 | } 353 | 354 | public void setAuthoritiesDisabled(Boolean authoritiesDisabled) { 355 | this.authoritiesDisabled = authoritiesDisabled; 356 | } 357 | 358 | public void setUsersLocation(String usersLocation) { 359 | this.usersLocation = usersLocation; 360 | } 361 | 362 | public void setPeopleLocation(String peopleLocation) { 363 | this.peopleLocation = peopleLocation; 364 | } 365 | 366 | public void setGroupsLocation(String groupsLocation) { 367 | this.groupsLocation = groupsLocation; 368 | } 369 | 370 | 371 | public void setModelsXmlLocation(String modelsXmlLocation) { 372 | this.modelsXmlLocation = modelsXmlLocation; 373 | } 374 | 375 | public void setModelsLabelsLocation(String modelsLabelsLocation) { 376 | this.modelsLabelsLocation = modelsLabelsLocation; 377 | } 378 | 379 | public void setModelsDisabled(Boolean modelsDisabled) { 380 | this.modelsDisabled = modelsDisabled; 381 | } 382 | 383 | public void setRepoDisabled(Boolean repoDisabled) { 384 | this.repoDisabled = repoDisabled; 385 | } 386 | 387 | public void setRepoLocation(String repoLocation) { 388 | this.repoLocation = repoLocation; 389 | } 390 | 391 | public void setWfDisabled(Boolean wfDisabled) { 392 | this.wfDisabled = wfDisabled; 393 | } 394 | 395 | public void setWfDefinitionsLocation(String wfDefinitionsLocation) { 396 | this.wfDefinitionsLocation = wfDefinitionsLocation; 397 | } 398 | 399 | public void setWfModelsLocation(String wfModelsLocation) { 400 | this.wfModelsLocation = wfModelsLocation; 401 | } 402 | 403 | public void setWfLabelsLocation(String wfLabelsLocation) { 404 | this.wfLabelsLocation = wfLabelsLocation; 405 | } 406 | 407 | public void setUpdateGroups(Boolean updateGroups) { 408 | this.updateGroups = updateGroups; 409 | } 410 | } -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/java/org/alfresco/devops/services/ResourcesResolver.java: -------------------------------------------------------------------------------- 1 | package org.alfresco.devops.services; 2 | 3 | import java.io.FileNotFoundException; 4 | import java.io.IOException; 5 | import java.net.URL; 6 | import java.util.HashSet; 7 | import java.util.Set; 8 | 9 | import org.alfresco.devops.util.Constants; 10 | import org.apache.commons.logging.Log; 11 | import org.apache.commons.logging.LogFactory; 12 | import org.springframework.core.io.Resource; 13 | import org.springframework.core.io.support.PathMatchingResourcePatternResolver; 14 | import org.springframework.core.io.support.ResourcePatternResolver; 15 | 16 | public class ResourcesResolver { 17 | 18 | private static Log logger = LogFactory.getLog(ResourcesResolver.class); 19 | 20 | 21 | private final ResourcePatternResolver resourcePatternResolver = new PathMatchingResourcePatternResolver(); 22 | 23 | public Set resolveResourcesFromAMP(String path) { 24 | Set res = new HashSet(); 25 | try{ 26 | final Resource[] resources = resourcePatternResolver.getResources(path); 27 | 28 | for (final Resource resource : resources) { 29 | final URL url = resource.getURL(); 30 | int index = getIndex(url.toString()); 31 | if(index>=0){ 32 | String internalFilePath = url.toString().substring(index); 33 | internalFilePath = internalFilePath.replace("%20", " "); 34 | res.add(internalFilePath); 35 | } 36 | } 37 | } 38 | catch(FileNotFoundException fne){ 39 | logger.warn("Error to resolve "+path); 40 | } 41 | catch(IOException iex){ 42 | logger.error("IOException "+path); 43 | } 44 | catch(Exception ex){ 45 | logger.error("Generic error getting "+path,ex); 46 | } 47 | 48 | return res; 49 | } 50 | 51 | 52 | public boolean existsResource(String path) throws IOException { 53 | final Resource resource = resourcePatternResolver.getResource(path); 54 | if(resource!=null && resource.exists()) 55 | return true; 56 | else{ 57 | return false; 58 | } 59 | } 60 | 61 | private int getIndex(String url){ 62 | if(url.indexOf(Constants.MODULE_PATH)>0){ 63 | return url.indexOf(Constants.MODULE_PATH); 64 | } 65 | else if(url.indexOf(Constants.EXTENSION_PATH)>0){ 66 | return url.indexOf(Constants.EXTENSION_PATH); 67 | } 68 | else return -1; 69 | } 70 | 71 | 72 | } 73 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/main/java/org/alfresco/devops/util/Constants.java: -------------------------------------------------------------------------------- 1 | package org.alfresco.devops.util; 2 | 3 | public final class Constants { 4 | 5 | public static final String GROUP_NAME = "name"; 6 | public static final String GROUP_DISPLAYNAME = "displayName"; 7 | public static final String GROUP_MEMBERS = "members"; 8 | public static final String GROUP_ZONES = "zones"; 9 | public static final String GROUP_SUBGROUPS = "groups"; 10 | public static final String GROUPS = "groups"; 11 | public static final String PEOPLE = "people"; 12 | public static final String USERS = "users"; 13 | public static final String LOCATION = "location"; 14 | public static final String ID = "id"; 15 | public static final String DISABLED = "disabled"; 16 | public static final String BOOTSTRAPVIEWS = "bootstrapViews"; 17 | public static final String BOOTSTRAPVIEW = "bootstrapView"; 18 | public static final String CONTENTS = "contents"; 19 | public static final String SITENAME = "siteName"; 20 | public static final String MODULE_PATH="alfresco/module"; 21 | public static final String EXTENSION_PATH="alfresco/extension"; 22 | public static final String GROUP_SITE = "GROUP_site_"; 23 | public static final String PATH = "path"; 24 | public static final String UUIDBINDING = "uuidBinding"; 25 | public static final String MESSAGES = "messages"; 26 | public static final String REPLACE_EXISTING = "REPLACE_EXISTING"; 27 | public static final String MESSAGES_BOOTSTRAP_SPACES = "alfresco/messages/bootstrap-spaces"; 28 | public static final String DICTIONARY_MODEL_BOOTSTRAP ="dictionaryModelBootstrap"; 29 | public static final String WORKFLOW_DEPLOYER ="workflowDeployer"; 30 | public static final String DICTIONARY_BOOTSTRAP = "dictionaryBootstrap"; 31 | public static final String MODELS = "models"; 32 | public static final String LABELS = "labels"; 33 | public static final String WORKFLOW_DEFINITIONS = "workflowDefinitions"; 34 | public static final String REPO_IMPORT_BEAN_ID_PREFIX = "demodata_repoImport_"; 35 | 36 | public static final String ENGINE_ID ="engineId"; 37 | public static final String ACTIVITI ="activiti"; 38 | public static final String MIMETYPE = "mimetype"; 39 | public static final String REDEPLOY = "redeploy"; 40 | 41 | 42 | public static final String USERS_BEAN_ID = "patch.demoData.users"; 43 | public static final String GROUPS_BEAN_ID = "patch.demoData.groups"; 44 | public static final String SITES_BEAN_ID = "patch.demoData.sites."; 45 | public static final String RM_FIX_BEAN_ID = "patch.demoData.rmFix"; 46 | 47 | public static final String USERS_PATCH_ID = "patch.demoData.users"; 48 | public static final String GROUPS_PATCH_ID = "patch.demoData.groups"; 49 | public static final String SITES_PATCH_ID = "patch.demoData.sites."; 50 | public static final String RM_FIX_PATCH_ID = "patch.demoData.rmFix"; 51 | 52 | public static final String USERS_PARENT_BEAN = "patch.usersPatch.generic"; 53 | public static final String GROUPS_PARENT_BEAN = "patch.groupsPatch.generic"; 54 | public static final String SITES_PARENT_BEAN = "patch.siteLoadPatch.generic"; 55 | public static final String RM_FIX_PARENT_BEAN = "patch.abstract.fixRMSite"; 56 | 57 | public static final String DEMODATA_REPO_PARENT_BEAN = "patch.import.demodata.repo"; 58 | 59 | 60 | private Constants(){ 61 | throw new AssertionError(); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/test/properties/local/alfresco-global.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | ######################################################################################################################## 17 | # Alfresco configuration for running locally 18 | # 19 | # Configuration when running Tomcat embedded from Maven. 20 | # This will create the alf_data_dev directory relative to Tomcat run folder. 21 | # Property values from the POM but it can also be edited here. 22 | ######################################################################################################################## 23 | 24 | dir.root=${alfresco.data.location} 25 | 26 | # Use Solr4 as that is used by default with Alfresco 5 27 | index.subsystem.name=solr4 28 | solr.host=localhost 29 | solr.port=8080 30 | solr.secureComms=none 31 | 32 | # Fail or not when there are node integrity checker errors 33 | integrity.failOnError=true 34 | 35 | # Database connection properties 36 | db.driver=${alfresco.db.datasource.class} 37 | db.url=${alfresco.db.url} 38 | db.username=${alfresco.db.username} 39 | db.password=${alfresco.db.password} 40 | db.pool.initial=10 41 | db.pool.max=100 42 | hibernate.dialect=org.hibernate.dialect.H2Dialect 43 | 44 | # File servers related properties 45 | # For local runs we disable CIFS and FTP 46 | cifs.enabled=false 47 | ftp.enabled=false 48 | 49 | jodconverter.enabled=false 50 | ooo.enabled=false 51 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/test/resources/alfresco/extension/disable-webscript-caching-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 19 | 20 | 21 | 22 | 23 | javascript 24 | 25 | 26 | js 27 | 28 | 29 | 30 | false 31 | 32 | 33 | 34 | 35 | true 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | ${spaces.store} 46 | 47 | 48 | ${spaces.company_home.childname} 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /alfresco-demo-data-repo-amp/src/test/resources/test-log4j.properties: -------------------------------------------------------------------------------- 1 | # Overrides only log4j locations and add the test logging properties 2 | # This gets merged with the main file 3 | 4 | # Set root logger level to error 5 | log4j.rootLogger=${app.log.root.level}, Console, File 6 | 7 | ###### Console appender definition ####### 8 | 9 | # All outputs currently set to be a ConsoleAppender. 10 | log4j.appender.Console=org.apache.log4j.ConsoleAppender 11 | log4j.appender.Console.layout=org.apache.log4j.PatternLayout 12 | 13 | # use log4j NDC to replace %x with tenant domain / username 14 | log4j.appender.Console.layout.ConversionPattern=%d{ISO8601} %x %-5p [%c{3}] [%t] %m%n 15 | #log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n 16 | 17 | ###### File appender definition ####### 18 | log4j.appender.File=org.apache.log4j.DailyRollingFileAppender 19 | log4j.appender.File.File=${app.log.dir}alfresco.log 20 | log4j.appender.File.Append=true 21 | log4j.appender.File.DatePattern='.'yyyy-MM-dd 22 | log4j.appender.File.layout=org.apache.log4j.PatternLayout 23 | log4j.appender.File.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n -------------------------------------------------------------------------------- /alfresco-demo-data-share-amp/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | alfresco-demo-data-share-amp 5 | Alfresco Share AMP Module 6 | amp 7 | This is a sample Alfresco Share AMP project, depended upon by the share WAR module 8 | 9 | 10 | org.alfresco.devops 11 | alfresco-demo-data 12 | 0.7-SNAPSHOT 13 | 14 | 15 | 16 | share 17 | WARN 18 | 19 | 20 | 21 | 22 | ${alfresco.groupId} 23 | share 24 | ${alfresco.version} 25 | classes 26 | provided 27 | 28 | 29 | 30 | org.springframework.extensions.surf 31 | spring-surf-api 32 | provided 33 | 34 | 35 | 36 | ${alfresco.groupId} 37 | share-po 38 | ${alfresco.version} 39 | test 40 | 41 | 42 | 43 | ${alfresco.groupId} 44 | share-po 45 | ${alfresco.version} 46 | tests 47 | test 48 | 49 | 50 | 51 | org.seleniumhq.selenium 52 | selenium-java 53 | 54 | 55 | org.seleniumhq.selenium 56 | selenium-server 57 | 58 | 59 | 60 | 61 | org.seleniumhq.selenium 62 | selenium-java 63 | 2.45.0-alfresco 64 | test 65 | 66 | 67 | org.alfresco.test 68 | alfresco-testng 69 | 1.1 70 | test 71 | 72 | 73 | org.hamcrest 74 | hamcrest-core 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /alfresco-demo-data-share-amp/src/main/amp/config/alfresco/web-extension/custom-slingshot-application-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | webscripts.messages.webscripts 11 | alfresco.messages.common 12 | alfresco.messages.slingshot 13 | alfresco.web-extension.messages.marketingmodel 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /alfresco-demo-data-share-amp/src/main/amp/config/alfresco/web-extension/messages/marketingmodel.properties: -------------------------------------------------------------------------------- 1 | # shared/classes/alfresco/web-extension/messages 2 | 3 | # Aspects 4 | aspect.dm_customer=Customer Details 5 | aspect.dm_supplier=Supplier Details 6 | aspect.dm_employee=Employee Details 7 | aspect.dm_docstatus=Document Status 8 | aspect.dm_product=Product Details 9 | 10 | # Types 11 | type.dm_contract=Contract 12 | type.dm_sop=Standard Operating Procedure 13 | type.dm_report=Report 14 | type.dm_casefile=Case File 15 | type.dm_issuelog=Issue Log 16 | type.dm_proposal=Proposal 17 | type.dm_meetingnotes=Meeting Notes 18 | type.dm_invoice=Invoice 19 | type.dm_po=Purchase Order 20 | type.dm_marketingdoc=Marketing Document 21 | -------------------------------------------------------------------------------- /alfresco-demo-data-share-amp/src/main/amp/file-mapping.properties: -------------------------------------------------------------------------------- 1 | # Custom AMP to WAR location mappings 2 | 3 | # 4 | # The following property can be used to include the standard set of mappings. 5 | # The contents of this file will override any defaults. The default is 6 | # 'true', i.e. the default mappings will be augmented or modified by values in 7 | # this file. 8 | # 9 | include.default=true 10 | 11 | # 12 | # Custom mappings. If 'include.default' is false, then this is the complete set. 13 | # 14 | /web=/ -------------------------------------------------------------------------------- /alfresco-demo-data-share-amp/src/main/amp/module.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | 17 | 18 | # SDK Sample module 19 | 20 | # ==== Beginning of Alfresco required/optional properties ====== # 21 | # NB: These properties are filtered at build time by Maven, single 22 | # sourcing from POM properties 23 | module.id=${project.artifactId} 24 | #module.aliases=myModule-123, my-module 25 | module.title=${project.name} 26 | module.description=${project.description} 27 | module.version=${noSnapshotVersion} 28 | 29 | # The following optional properties can be used to prevent the module from being added 30 | # to inappropriate versions of the WAR file. 31 | # module.repo.version.min=2.0 32 | # module.repo.version.max=2.1 33 | 34 | # FIXME: This dependencies should come out of mvn dependencies on amp 35 | 36 | # The following describe dependencies on other modules 37 | # Depends on net.sf.myproject.module.SupportModuleA version ${version} or later 38 | # module.depends.net.sf.myproject.module.SupportModuleA=${version}-* 39 | # Depends on net.sf.myproject.module.SupportModuleA version ${version} to 2.0 40 | # module.depends.net.sf.myproject.module.SupportModuleB=${version}-2.0 41 | # Depends on net.sf.myproject.module.SupportModuleC - any version 42 | # module.depends.net.sf.myproject.module.SupportModuleB=* 43 | 44 | 45 | # ==== End of Alfresco required/optional properties ======= # 46 | 47 | 48 | # ==== Beginning of module required properties/optional ====== # -------------------------------------------------------------------------------- /clean-data.sh: -------------------------------------------------------------------------------- 1 | find alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic/sites/* -mindepth 1 -type d -delete 2 | find alfresco-demo-data-repo-amp/src/main/amp/config/alfresco/module/alfresco-demo-data-repo-amp/bootstrap/dynamic -type f -name '*.*' -delete 3 | 4 | 5 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | org.alfresco.devops 5 | alfresco-demo-data 6 | 0.7-SNAPSHOT 7 | Alfresco Repository and Share Quickstart with database and an embedded Tomcat runner. 8 | This All-in-One project allows to manage all the components involved in Alfresco development (Repo, Share, Solr4, AMPs) in one project 9 | 10 | pom 11 | 12 | 13 | org.alfresco.maven 14 | alfresco-sdk-parent 15 | 2.1.1 16 | 17 | 18 | 19 | scm:git:git@github.com:maoo/alfresco-demo-data.git 20 | scm:git:git@github.com:maoo/alfresco-demo-data.git 21 | scm:git:git@github.com:maoo/alfresco-demo-data.git 22 | HEAD 23 | 24 | 25 | 26 | 27 | alfresco-internal 28 | https://artifacts.alfresco.com/nexus/content/repositories/internal-releases 29 | 30 | 31 | alfresco-internal-snapshots 32 | https://artifacts.alfresco.com/nexus/content/repositories/internal-snapshots 33 | 34 | 35 | 36 | 37 | 38 | 5.1.1 39 | alfresco-enterprise 40 | share 41 | provided 42 | 2.5-SNAPSHOT 43 | ${session.executionRootDirectory}/alf_data_dev 44 | http://localhost:8080/share 45 | 2.5.1 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | alfresco-private-repository 55 | https://artifacts.alfresco.com/nexus/content/groups/private 56 | 57 | 58 | 59 | 60 | 62 | 63 | 64 | 65 | ${alfresco.groupId} 66 | alfresco-platform-distribution 67 | ${alfresco.version} 68 | pom 69 | import 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | org.apache.maven.plugins 78 | maven-release-plugin 79 | ${maven.release.plugin.version} 80 | 81 | 82 | net.alchim31.maven 83 | yuicompressor-maven-plugin 84 | 85 | 86 | org.alfresco.maven.plugin 87 | alfresco-maven-plugin 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | alfresco-private-repository 101 | https://artifacts.alfresco.com/nexus/content/groups/private 102 | 103 | 104 | 105 | 106 | 107 | 108 | run 109 | 110 | false 111 | 112 | 113 | 114 | 115 | 116 | alfresco-demo-data-repo-amp 117 | alfresco-demo-data-exporter-repo-amp 118 | alfresco-demo-data-share-amp 119 | repo 120 | solr-config 121 | share 122 | runner 123 | 124 | -------------------------------------------------------------------------------- /repo/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 4.0.0 15 | repo 16 | Alfresco Repository WAR Aggregator 17 | war 18 | Alfresco Repository aggregator, installs your repository AMPs in the Alfresco WAR for aggregation and easy deployment purposes 19 | 20 | 21 | org.alfresco.devops 22 | alfresco-demo-data 23 | 0.7-SNAPSHOT 24 | 25 | 26 | 27 | 28 | ${alfresco.groupId} 29 | ${alfresco.repo.artifactId} 30 | ${alfresco.version} 31 | war 32 | 33 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 57 | 59 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | org.apache.maven.plugins 69 | maven-deploy-plugin 70 | 71 | true 72 | 73 | 74 | 75 | maven-war-plugin 76 | 77 | 82 | 83 | 85 | 86 | 87 | 88 | ${alfresco.groupId} 89 | ${alfresco.repo.artifactId} 90 | war 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 114 | 115 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 128 | 129 | run 130 | 131 | 132 | 133 | maven-war-plugin 134 | 135 | 136 | prepare-exploded-war 137 | 138 | exploded 139 | 140 | prepare-package 141 | 142 | 143 | default-war 144 | 145 | ${project.build.directory}/${project.build.finalName}-nossl/WEB-INF/web.xml 146 | 147 | 148 | 149 | 150 | 151 | 152 | com.google.code.maven-replacer-plugin 153 | replacer 154 | 155 | 156 | disable-securecomms 157 | prepare-package 158 | 159 | replace 160 | 161 | 162 | 163 | 164 | true 165 | ${project.build.directory}/${project.build.finalName}/WEB-INF/web.xml 166 | ${project.build.directory}/${project.build.finalName}-nossl/WEB-INF/ 167 | false 168 | 169 | 170 | ]]> 171 | 172 | 173 | 174 | ]]> 175 | ]]> 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | org.alfresco.maven 185 | alfresco-rad 186 | ${maven.alfresco.version} 187 | 188 | 189 | 190 | 191 | 192 | -------------------------------------------------------------------------------- /repo/src/main/properties/local/alfresco-global.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one or more 2 | # contributor license agreements. See the NOTICE file distributed with 3 | # this work for additional information regarding copyright ownership. 4 | # The ASF licenses this file to You under the Apache License, Version 2.0 5 | # (the "License"); you may not use this file except in compliance with 6 | # the License. You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # RUN TIME PROPERTIES 16 | # ------------------- 17 | 18 | ######################################################################################################################## 19 | # Alfresco configuration for running locally 20 | # 21 | # Configuration when running Tomcat embedded from Maven. 22 | # This will create the alf_data_dev directory relative to Tomcat run folder. 23 | # Property values from the POM but it can also be edited here. 24 | ######################################################################################################################## 25 | 26 | dir.root=${alfresco.data.location} 27 | 28 | # Alfresco Repo Webapp (alfresco.war) context, ports etc 29 | alfresco.context=alfresco 30 | alfresco.host=localhost 31 | alfresco.port=8080 32 | alfresco.protocol=http 33 | 34 | # Alfresco Share Webapp (share.war) context, ports etc 35 | share.context=share 36 | share.host=localhost 37 | share.port=8080 38 | share.protocol=http 39 | 40 | # Use Solr4 as that is used by default with Alfresco 5 41 | index.subsystem.name=solr4 42 | solr.host=localhost 43 | solr.port=8080 44 | solr.secureComms=none 45 | 46 | # Setting Solr backup for the future. Tweak this if needed (ideally in other env properties files) 47 | solr.backup.alfresco.cronExpression=0 30 2 * * ? 2050 48 | solr.backup.archive.cronExpression=0 30 3 * * ? 2050 49 | solr.backup.alfresco.remoteBackupLocation=${dir.root}/solr4Backup/alfresco 50 | solr.backup.archive.remoteBackupLocation=${dir.root}/solr4Backup/archive 51 | 52 | # We are in the local DEV properties file, no need for Solr backup 53 | solr.backup.alfresco.numberToKeep=0 54 | solr.backup.archive.numberToKeep=0 55 | 56 | # These jobs seem to require Lucene (Unsupported Operation with Solr) so we disable them / set to future date 57 | # See https://forums.alfresco.com/en/viewtopic.php?f=52&t=41597 58 | # If you want to enable them (and so full WQS functionality), please also set index.subsystem.name=lucene 59 | wcmqs.dynamicCollectionProcessor.schedule=0 30 2 * * ? 2060 60 | wcmqs.feedbackProcessor.schedule=0 40 2 * * ? 2060 61 | wcmqs.publishQueueProcessor.schedule=0 50 2 * * ? 2060 62 | 63 | # Fail or not when there are node integrity checker errors 64 | integrity.failOnError=true 65 | 66 | # Database connection properties 67 | db.driver=${alfresco.db.datasource.class} 68 | db.url=${alfresco.db.url} 69 | db.username=${alfresco.db.username} 70 | db.password=${alfresco.db.password} 71 | db.pool.initial=10 72 | db.pool.max=100 73 | hibernate.dialect=org.hibernate.dialect.H2Dialect 74 | 75 | # File servers related properties 76 | # For local runs we disable CIFS and FTP 77 | cifs.enabled=false 78 | ftp.enabled=false -------------------------------------------------------------------------------- /repo/src/main/resources/alfresco/extension/dev-log4j.properties: -------------------------------------------------------------------------------- 1 | # You can add here custom log4j classes. This will be merged with the main log4j.properties 2 | # See http://wiki.alfresco.com/wiki/Developing_an_Alfresco_Module#Best_Log4j_Configuration_Practices -------------------------------------------------------------------------------- /run-debug.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Downloads the spring-loaded lib if not existing and runs the full all-in-one 3 | # (Alfresco + Share + Solr) using the runner project 4 | springloadedfile=~/.m2/repository/org/springframework/springloaded/1.2.3.RELEASE/springloaded-1.2.3.RELEASE.jar 5 | 6 | if [ ! -f $springloadedfile ]; then 7 | mvn validate -Psetup 8 | fi 9 | # 5.1 + spring loaded != good combo right now 10 | MAVEN_OPTS="-noverify -Xms512m -Xmx4G" mvnDebug clean install -Prun 11 | -------------------------------------------------------------------------------- /run.bat: -------------------------------------------------------------------------------- 1 | :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 2 | :: Dev environment startup script for Alfresco Community :: 3 | :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 4 | @echo off 5 | 6 | set springloadedfile=%HOME%\.m2\repository\org\springframework\springloaded\1.2.3.RELEASE\springloaded-1.2.3.RELEASE.jar 7 | 8 | if not exist %springloadedfile% ( 9 | mvn validate -Psetup 10 | ) 11 | 12 | set MAVEN_OPTS=-Xms256m -Xmx2G 13 | 14 | mvn install -Prun -nsu 15 | :: mvn install -Prun 16 | -------------------------------------------------------------------------------- /run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Downloads the spring-loaded lib if not existing and runs the full all-in-one 3 | # (Alfresco + Share + Solr) using the runner project 4 | springloadedfile=~/.m2/repository/org/springframework/springloaded/1.2.3.RELEASE/springloaded-1.2.3.RELEASE.jar 5 | 6 | if [ ! -f $springloadedfile ]; then 7 | mvn validate -Psetup 8 | fi 9 | # 5.1 + spring loaded != good combo right now 10 | MAVEN_OPTS="-noverify -Xms512m -Xmx4G" mvn clean install -Prun 11 | #MAVEN_OPTS="-javaagent:$springloadedfile -noverify -Xms256m -Xmx2G" mvn clean install -Prun 12 | #MAVEN_OPTS="-javaagent:$springloadedfile -noverify -Xms256m -Xmx2G -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044" mvn clean install -Prun 13 | -------------------------------------------------------------------------------- /runner/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Alfresco SDK 2.1.0 - Running Alfresco ${alfresco.version} 4 | 5 | 6 | Maven Alfresco SDK 7 |

Congratulations, you are successfully running the All in One project from the Alfresco SDK 2.1.0, powered by Apache Maven! 8 |
9 | You can access the Alfresco components running embedded below:

10 | 15 |

Resources:

16 | 23 | 24 | -------------------------------------------------------------------------------- /runner/test-ng/testng-alfresco-share.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /runner/tomcat/context-repo.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 13 | 14 | 15 | 17 | 18 | 19 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /runner/tomcat/context-share.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 14 | 15 | 16 | 25 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /runner/tomcat/context-solr.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 10 | 12 | 13 | 14 | 15 | 20 | 21 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /share/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | share 5 | Alfresco Share WAR Aggregator 6 | war 7 | Alfresco Share aggregator, installs your Share AMPs in the Share WAR for aggregation and easy deployment purposes 8 | 9 | 10 | org.alfresco.devops 11 | alfresco-demo-data 12 | 0.7-SNAPSHOT 13 | 14 | 15 | 16 | 18 | http://localhost:8080/alfresco 19 | 20 | 21 | 22 | 23 | ${alfresco.groupId} 24 | ${alfresco.share.artifactId} 25 | ${alfresco.version} 26 | war 27 | 28 | 30 | 31 | ${project.groupId} 32 | alfresco-demo-data-share-amp 33 | ${project.version} 34 | amp 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | org.apache.maven.plugins 51 | maven-deploy-plugin 52 | 53 | true 54 | 55 | 56 | 57 | maven-dependency-plugin 58 | 59 | 60 | unpack 61 | generate-sources 62 | 63 | unpack-dependencies 64 | 65 | 66 | war 67 | org.alfresco 68 | share 69 | META-INF/MANIFEST.MF 70 | 71 | 72 | 73 | 74 | 75 | maven-war-plugin 76 | 77 | 78 | false 79 | ${project.build.directory}/dependency/META-INF/MANIFEST.MF 80 | 81 | 82 | 83 | 88 | 89 | 90 | 91 | 92 | 93 | ${alfresco.groupId} 94 | ${alfresco.share.artifactId} 95 | war 96 | 97 | 98 | 99 | 100 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /share/src/main/resources/alfresco/web-extension/custom-slingshot-application-context.xml.sample: -------------------------------------------------------------------------------- 1 | 8 | 9 | 16 | 17 | 22 | 23 | 24 | 25 | 60 | 61 | 62 | 63 | 76 | 77 | 78 | 79 | 80 | 97 | 98 | 99 | 100 | 118 | 119 | -------------------------------------------------------------------------------- /share/src/main/resources/alfresco/web-extension/share-config-custom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /share/src/main/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # Set root logger level to error 2 | log4j.rootLogger=error, Console, File 3 | 4 | ###### Console appender definition ####### 5 | 6 | # All outputs currently set to be a ConsoleAppender. 7 | log4j.appender.Console=org.apache.log4j.ConsoleAppender 8 | log4j.appender.Console.layout=org.apache.log4j.PatternLayout 9 | 10 | # use log4j NDC to replace %x with tenant domain / username 11 | log4j.appender.Console.layout.ConversionPattern=%d{ISO8601} %x %-5p [%c{3}] [%t] %m%n 12 | #log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n 13 | 14 | ###### File appender definition ####### 15 | log4j.appender.File=org.apache.log4j.DailyRollingFileAppender 16 | log4j.appender.File.File=${app.log.dir}share.log 17 | log4j.appender.File.Append=true 18 | log4j.appender.File.DatePattern='.'yyyy-MM-dd 19 | log4j.appender.File.layout=org.apache.log4j.PatternLayout 20 | log4j.appender.File.layout.ConversionPattern=%d{yyyy-MM-dd} %d{ABSOLUTE} %-5p [%c] [%t] %m%n 21 | 22 | # Spring 23 | log4j.logger.org.springframework=warn 24 | # Turn off Spring remoting warnings that should really be info or debug. 25 | log4j.logger.org.springframework.remoting.support=error 26 | log4j.logger.org.springframework.util=error 27 | 28 | # MyFaces 29 | log4j.logger.org.apache.myfaces.util.DebugUtils=info 30 | log4j.logger.org.apache.myfaces.el.VariableResolverImpl=error 31 | log4j.logger.org.apache.myfaces.application.jsp.JspViewHandlerImpl=error 32 | log4j.logger.org.apache.myfaces.taglib=error 33 | 34 | # Alfresco 35 | log4j.logger.org.alfresco=error 36 | log4j.logger.org.alfresco.config=warn 37 | log4j.logger.org.alfresco.config.JndiObjectFactoryBean=warn 38 | log4j.logger.org.alfresco.web=info 39 | 40 | # Web Framework 41 | log4j.logger.org.springframework.extensions.webscripts=info 42 | log4j.logger.org.springframework.extensions.webscripts.ScriptLogger=warn 43 | log4j.logger.org.springframework.extensions.webscripts.ScriptDebugger=off 44 | 45 | # Freemarker 46 | # Note the freemarker.runtime logger is used to log non-fatal errors that are handled by Alfresco's retrying transaction handler 47 | log4j.logger.freemarker.runtime= -------------------------------------------------------------------------------- /share/src/test/resources/alfresco/web-extension/share-config-custom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | false 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /share/src/test/resources/log4j.properties: -------------------------------------------------------------------------------- 1 | # This file is copied from Alfresco Share 5.0.d 2 | # Overrides tomcat/webapps/share/WEB-INF/classes/log4j,properties 3 | # and sets new file location from property and log level from property. 4 | # 5 | 6 | # Set root logger level to error 7 | log4j.rootLogger=${app.log.root.level}, Console, File 8 | 9 | 10 | # All outputs currently set to be a ConsoleAppender. 11 | log4j.appender.Console=org.apache.log4j.ConsoleAppender 12 | log4j.appender.Console.layout=org.apache.log4j.PatternLayout 13 | 14 | # use log4j NDC to replace %x with tenant domain / username 15 | log4j.appender.Console.layout.ConversionPattern=%d{ISO8601} %x %-5p [%c{3}] [%t] %m%n 16 | #log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n 17 | 18 | log4j.appender.File=org.apache.log4j.DailyRollingFileAppender 19 | log4j.appender.File.File=${app.log.dir}alfresco.log 20 | log4j.appender.File.Append=true 21 | log4j.appender.File.DatePattern='.'yyyy-MM-dd 22 | log4j.appender.File.layout=org.apache.log4j.PatternLayout 23 | log4j.appender.File.layout.ConversionPattern=%d{yyyy-MM-dd} %d{ABSOLUTE} %-5p [%c] [%t] %m%n 24 | 25 | # Spring 26 | log4j.logger.org.springframework=warn 27 | # Turn off Spring remoting warnings that should really be info or debug. 28 | log4j.logger.org.springframework.remoting.support=error 29 | log4j.logger.org.springframework.util=error 30 | 31 | # MyFaces 32 | log4j.logger.org.apache.myfaces.util.DebugUtils=info 33 | log4j.logger.org.apache.myfaces.el.VariableResolverImpl=error 34 | log4j.logger.org.apache.myfaces.application.jsp.JspViewHandlerImpl=error 35 | log4j.logger.org.apache.myfaces.taglib=error 36 | 37 | # Alfresco 38 | log4j.logger.org.alfresco=error 39 | log4j.logger.org.alfresco.config=warn 40 | log4j.logger.org.alfresco.config.JndiObjectFactoryBean=warn 41 | log4j.logger.org.alfresco.web=info 42 | 43 | # Web Framework 44 | log4j.logger.org.springframework.extensions.webscripts=info 45 | log4j.logger.org.springframework.extensions.webscripts.ScriptLogger=warn 46 | log4j.logger.org.springframework.extensions.webscripts.ScriptDebugger=off 47 | 48 | # Freemarker 49 | # Note the freemarker.runtime logger is used to log non-fatal errors that are handled by Alfresco's retrying transaction handler 50 | log4j.logger.freemarker.runtime= -------------------------------------------------------------------------------- /solr-config/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4.0.0 4 | 5 | solr-config 6 | pom 7 | Alfresco Solr 4 Configuration 8 | Apache Solr 4 Configuration Customization 9 | 10 | 12 | 13 | org.alfresco.devops 14 | alfresco-demo-data 15 | 0.7-SNAPSHOT 16 | 17 | 18 | 21 | 22 | 23 | run 24 | 25 | 26 | ${alfresco.data.location}/solr4 27 | ${alfresco.solr.dir}/config 28 | ${alfresco.solr.dir}/data 29 | 30 | 31 | 32 | 34 | 35 | ${alfresco.groupId} 36 | alfresco-solr4 37 | ${alfresco.version} 38 | config 39 | zip 40 | 41 | 42 | 43 | 44 | 45 | 46 | org.apache.maven.plugins 47 | maven-deploy-plugin 48 | 49 | true 50 | 51 | 52 | 55 | 56 | org.apache.maven.plugins 57 | maven-dependency-plugin 58 | 59 | 60 | unpack-alfresco-config 61 | 62 | unpack 63 | 64 | generate-resources 65 | 66 | ${alfresco.solr.home.dir} 67 | 68 | 69 | ${alfresco.groupId} 70 | alfresco-solr4 71 | ${alfresco.version} 72 | config 73 | zip 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 83 | 84 | org.codehaus.mojo 85 | build-helper-maven-plugin 86 | 87 | 88 | regexp-property 89 | generate-resources 90 | 91 | regex-property 92 | 93 | 94 | 95 | 96 | solrDataDir 97 | ${alfresco.solr.data.dir} 98 | \\ 99 | / 100 | false 101 | 102 | 103 | 104 | 105 | 107 | 108 | com.google.code.maven-replacer-plugin 109 | replacer 110 | 111 | 112 | setup-solr-config 113 | generate-resources 114 | 115 | replace 116 | 117 | 118 | 119 | 120 | false 121 | 122 | ${alfresco.solr.home.dir}/archive-SpacesStore/conf/solrcore.properties 123 | ${alfresco.solr.home.dir}/workspace-SpacesStore/conf/solrcore.properties 124 | 125 | 126 | 127 | @@ALFRESCO_SOLR4_DATA_DIR@@ 128 | ${solrDataDir}/index 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | --------------------------------------------------------------------------------