Acosix / alfresco-simple-content-stores

Addon to provide a set of common content store implementations and easy-to-use configuration (no Spring config)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New questions wrt last version

ArnoLP opened this issue · comments

Hello Axel,

I have a few questions wrt the last version of the add-on. Sorry if some of them may be trivial for you.

  1. I cannot generate the amp from the sources. I saw a first issue that I solved in the POM
    de.acosix.alfresco.maven
    de.acosix.alfresco.maven.module.parent
    1.0.0.1-SNAPSHOT
    (I changed the original 1.0.0.0-SNAPSHOT by 1.0.0.1-SNAPSHOT as the first one doesn't exist anymore)

but then, I get a new problem and I don't know how to solve it :
[ERROR] Non-resolvable import POM: Failure to find org.alfresco:alfresco-platform-distribution:pom:5.1.g in https://oss.sonatype.org/content/repositories/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of ossrh has elapsed or updates are forced @ de.acosix.alfresco.maven:de.acosix.alfresco.maven.module.parent:1.0.0.1-SNAPSHOT, C:....m2\repository\de\acosix\alfresco\maven\de.acosix.alfresco.maven.module.parent\1.0.0.1-SNAPSHOT\de.acosix.alfresco.maven.module.parent-1.0.0.1-SNAPSHOT.pom, line 84, column 25

can you give me some information that can help me to solve this, please ?

  1. I am not sure I understand how the Site Routing Store works, and what it brings wrt what existed before.
    Before, we were able to define, for a site, the related content store.
    Ex.

root directory + protocol for site "My Site"

simpleContentStores.customStore.siteFileContentStore.map.rootAbsolutePathsBySite.value.my-site=${dir.root}/my-site-contentstore
simpleContentStores.customStore.siteFileContentStore.map.protocolsBySite.value.my-site=my-site-store

I don't understand what the difference is with the site routing store. Can you re-explain, please ? Does it avoid to make explicit the content store for each site, and so is it "constructed" automatically for each new site ? Or is it something completely different ?

And, for this Site Routing Store, I didn't understand what is the storeBySitePreset ? Can you give an example, and in which case it can help ?

  1. suppose sites already exist in a current Alfresco installation. What does occur if I set a specific content store for this site ? How does it behave ? Or should we avoid to setup a specific content store for an existing site ?

Thanks again for your very valuable work, and the help you can provide.

Kind Regards,

Arnaud.

I have recently switched the parent POM from Alfresco SDK to my Acosix Maven setup, but did not realize that I had various dependency cached / mirrored locally and the build would fail for other people. I have now included Travis CI into this project to have an external reference and corrected all dependency issues that came up. It should now build correctly for anyone.

The main difference between the "site routing store" and the "site file content store" is the fact that the latter always is the terminal content store and directly stores content in the file system. The "site routing store" on the other hand can be used to chain with other store implementations, e.g. the compression store, and is flexible in the means of how the content is actually stored - it depends completely on the routing / chain you configure and may be S3 instead of the file system.
Basically the "site file content store" is the simplest variant for the simplest of use cases while the "site routing store" is just small cog in an orchestration of multiple, flexible stores. But both do not "automatically" construct stores that have not been explicitly configured.

If a site content store (routing or smiple file) is added to an existing Alfresco system with existing content, access to any old content will work fine provided:

  • the root store is set up as an aggregating store
  • the new custom routing / file store is set as the primary store of the aggregating store
  • the path to existing content is served by a simple file store set as one of the secondary stores of the aggregating store

That way the aggregating store will serve existing content read-only from the old, existing path while the new custom (routing) store is used to store new content. Existing content will not be moved from the old store to the new store unless triggered by an user action (content update or move).
It is perfectly fine to add new, specific content stores for an existing site - you only need to make sure that the old content is still served somehow by the construct / chain of multiple stores. In my explanation above this is covered by the aggregating store and its secondary read-only backing store(s).

Hello Axel,

Thanks for your explanations. I'll come back on the functional aspects a few lines below.

I start with the build which still fails. It goes further than my last status, but I still get an error :

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.4:jar (attach-javadoc) on project de.axelfaust.alfresco.simplecontentstores.repo: MavenReportException: Error while generating Javadoc:
[ERROR] Exit code: 1 - C:\Users\Arnaud\kyp_dns323\Alfresco\add-ons\simple-content-stores-master\repository\src\main\java\de\axelfaust\alfresco\simplecontentstores\repo\store\context\ContentStoreContext.java:99: error: invalid use of @return
[ERROR] * @return the value of the attribute or {@code null} if it has not been set

Can you help, please ?

For the functional aspects, I have 2 questions :

  1. You explained that the root store should be an aggregating store to combine existing store, for read-only content, and new custom (or file) store for new added content.

However, my need is to define specific content stores for sites, while keeping all the other contents in the original content store..

I saw in your explanations for the SiteRoutingFileStore that I was able to define a specific content store for a site, while keeping the "original" one for all the other cases :

Example :

enable the addon

simpleContentStores.enabled=true

define the names of stores to configure

(multiple stores can be listed in comma-separated fashion)

simpleContentStores.customStores=siteFileContentStore

use the store as the global standard (instead of default fileContentStore)

simpleContentStores.rootStore=siteFileContentStore

define siteFileContentStore as a site routing file store

simpleContentStores.customStore.siteFileContentStore.type=siteRoutingFileStore

default root for all content not in sites or without special mapping

simpleContentStores.customStore.siteFileContentStore.value.rootDirectory=${dir.contentstore}

root directory + protocol for site "My Site"

simpleContentStores.customStore.siteFileContentStore.map.rootAbsolutePathsBySite.value.my-site=${dir.root}/my-site-contentstore
simpleContentStores.customStore.siteFileContentStore.map.protocolsBySite.value.my-site=my-site-store

activate relocation on move / copy

simpleContentStores.customStore.siteFileContentStore.value.moveStoresOnNodeMoveOrCopy=true

When I use this kind of configuration, if I set a specific content store for my-site which already exists and contains documents, what does occur ? Will it fail ? Will I have access to existing documents from the original content store, and new docs in the new specific one ? Or something else ?
Would it be possible to move the existing documents of the already existing site from the original content store to the new specifc content store ? So that all documents of the site are stored in the same specific content store ?

  1. would it be possible to have a specific "multi-sites" contenstore, to be used for sites, so that it's not needed to define a specific contentstore for each new created site ?
    Let me give an example :
  • new specific contenstore defined : ${dir.root}/multiSites_contentstore.

When I create a site siteA in Alfresco, then all the documents of this new site will be automatically stored in ${dir.root}/multiSites_contentstore/siteA, without being obliged to setup a specific configuration for this siteA.
When I create a new site siteB, then all new documents will be stored automatically in ${dir.root}/multiSites_contentstore/siteB.

It would allow to manage automatically the store of each site "independently", and avoid to be obliged to stop Alfresco, setup the configuration, and restart Alfresco for each new created site.

Hoping my explanations are clear enough, that it would be feasible, and you find it might be an interesting new feature for your simple-content-stores add-on.

Thanks again for your very valuable work, and help.

Kind Regards,

Arnaud.

The JavaDoc error has now been corrected. I have enabled JavaDoc generation via the central parent POM, and Java 8 JavaDoc tool is way more strict than in any previous versions (DocLint has been added).

When writing your comments you might want to check GitHub Markdown cheat sheets or guides so they may become more readable.

All routing stores have a default fallback if they cannot find a piece of content in the one specific backing store they "expect" to contain it: they simple check every backing store for it. So in the constellation you have put forward read access to the existing content will still work since it is stored in the rootDirectory path (which will be the default / fallback store). All new content will only be stored in your "my-site-contentstore" folder.
As soon as the existing content receives an update the new version will be stored in the "my-site-contentstore". The existing content will not be moved automatically. It can be forced by moving the file out of the site in Alfresco and back into the site again. Technically it is always just a copy - the original file will remain in the old content store location until Alfresco considers it to be orphaned long enough so that it is moved into the contentstore.deleted folder.

The siteFileContentStore is actually that kind of "multi-site" content store that you ask for. If you set the configuration property useSiteFolderInGenericDirectories to true for such a store, then any content stored in a site that is not handled by either rootAbsolutePathsBySite or rootAbsolutePathsBySitePreset will simply be stored in a sub-folder of rootDirectory where the name of the sub-folder is the name of the site. That way each site's contents will be stored in separate folders.

Hello Axel,

thanks for your feedback.

I'm sorry for the bad formatting of my comments, I was not used to leave comments ...

With regards to your last comment :

  • the generation is OK now.
  • I tested what you explained (with the useSiteFolderInGenericDirectories property), and it works fine. That's nice !
  • for the existing sites, if I undestood correctly, if I don't want them to use a specific contentstore but continue to use the default one, then I have to specify, for each of them, to use this default contentstore ?
    here is what I tried (the existing site I don't want to move being my-site), it seems to work OK, but can you confirm it's the right way to do it ? I reused your example of the Site Routing File Store, I just configured the rootAbsolutePathsBySite of my-site to the rootDirectory of the siteFileContentStore.
# enable the addon
simpleContentStores.enabled=true

# define the names of stores to configure
# (multiple stores can be listed in comma-separated fashion)
simpleContentStores.customStores=siteFileContentStore
# use the store as the global standard (instead of default fileContentStore)
simpleContentStores.rootStore=siteFileContentStore

# define siteFileContentStore as a site routing file store
simpleContentStores.customStore.siteFileContentStore.type=siteRoutingFileStore
# default root for all content not in sites or without special mapping
simpleContentStores.customStore.siteFileContentStore.value.rootDirectory=${dir.root}/contentstore
# root directory + protocol for site "My Site"
#simpleContentStores.customStore.siteFileContentStore.map.rootAbsolutePathsBySite.value.my-site=${dir.root}/contentstore
#simpleContentStores.customStore.siteFileContentStore.map.protocolsBySite.value.my-site=my-site-store
# activate relocation on move / copy
simpleContentStores.customStore.siteFileContentStore.value.moveStoresOnNodeMoveOrCopy=true
simpleContentStores.customStore.siteFileContentStore.value.useSiteFolderInGenericDirectories=true

Thanks in advance.

This configuration will work fine for most cases but I do see one significant problem here: accidental content deletion due to Alfresco's internal orphan handling.

Generally you should avoid storing content in the same directory when it may be referenced by content URLs that are identical in path and only differ in the protocol. E.g. if you move a file out of the site into any other place, it will be moved between the internal stores that the siteFileContentStore handles and get a new content URL with a different protocol. The old content URL will be put on an orphan list and after 14 days (by default) it will be considered orphaned long enough to be moved into contentstore.deleted. Since both the default and the site store use the same directory and the path within that directory will be identical, Alfresco may move an "in-use" content into contentstore.deleted.

So I would advice against this configuration.
What you'd need is kind of a "don't use site folders for these sites" setting which does not exist at the moment. But I am not sure adding such an option would be a good idea - I wanted to keep the configuration as simple as possible and there are already quite a lot of options.
I also believe that this constellation can already be dealt with using existing content stores, although it'd take three of them. E.g. the root store would be a site routing store, which routes the old store (and fallback) to a simple file store to ${dir.root}/contentstore, while the site preset "site-dashboard" (default preset for all sites) is routed to the siteFileContentStore as configured currently (minus the mapping for the old store, which won't be routed there anyway).
That way you would avoid the "different protocol for same file path" issue, and since all content in new sites will get a unique site-based path anyway they won't be affected by the problem in the first place, even if both the simple file store and the site file store have the same rootDirectory.
Since I am at work right now I cannot prepare a full configuration example for this, but I hope it is mostly clear what I mean.

Thanks for your quick feedback and your advice.

I tried what I understood from your explanations, but it fails (Alfresco doesn't start). I suppose I missed something.
However, there is still a point I don't understand, it's the site preset "site-dashboard". I don't understand what it is and why it it would only apply to the new sites and not the existing ones.

here is what I configured :

# enable the addon
simpleContentStores.enabled=true

# define the names of stores to configure
# (multiple stores can be listed in comma-separated fashion)
simpleContentStores.customStores=newSiteFileStore,siteRoutingStore
# use the store as the global standard (instead of default fileContentStore)
simpleContentStores.rootStore=siteRoutingStore

# define siteRoutingStore as a routing store
simpleContentStores.customStore.siteRoutingStore.type=siteRoutingStore
# store all non-routed content into the default file content store
simpleContentStores.customStore.siteRoutingStore.ref.fallbackStore=fileContentStore
simpleContentStores.customStore.siteRoutingStore.map.storeBySitePreset.ref.site-dashboard=newSiteFileStore

simpleContentStores.customStore.newSiteFileStore.type=standardFileStore
simpleContentStores.customStore.newSiteFileStore.value.rootDirectory=${dir.root}/newcontentstore
simpleContentStores.customStore.newSiteFileStore.value.moveStoresOnNodeMoveOrCopy=true
simpleContentStores.customStore.newSiteFileStore.value.useSiteFolderInGenericDirectories=true

Your feedback would be, as usual, very helpful.

Hi Axel,

have you has some chance to have a look at my last post ?
Would you have an advice to make it work ?

Thanks in advance.

Kind Regards,

Arnaud.

Sorry for not responding - I was a bit busy with other work and over the holidays forgot that you updated the thread just before christmas.

The "site preset" is an extra type identifier when creating a new site that tells Alfresco which template to use for the dashboard and/or available pages inside the site (document library, wiki etc.). It may not be visible by default in the "Create Site" dialog because there is only one preset in an out-of-the-box installation. Other presets may be added via customisation though. The selected preset will be stored as metadata on the site and will usually never be changed (there is no UI for this, other than admin access via the JavaScript Console).

Using the preset to define store routings allows an administrator to define routing for all sites of the same preset without having to list each individually. The preset "site-dashboard" is the default preset and by using it you basically configure content from all sites to be routed to the newSiteFileStore, while non-site content will fall back to the default fileContentStore.

This configuration would (as it is configured now) route new content for any site to the new store with the site-specific sub-folders. If you want to exclude the existing sites from routing, you'd have to configure each to use the fileContentStore, i.e.
´´´
simpleContentStores.customStore.siteRoutingStore.map.storeBySite.ref.oldSiteName=fileContentStore
´´´

Can you provide details regarding the error you are getting?

Hello Axel,

sorry for the delay to answer.

In fact, Alfresco doesn't start. there is no log is alfresco.log. I don't know what the cause is.

But, I must admit that I'm lost. I really don't see how I should configure the simple content store, so that my current sites continue to use the default content store while the new created ones use a new store with the site-specific sub-folders.

I tried what you propose in your last post, but Alfresco still doesn't start.

Could you help ?

Thanks in advance.

Then what about catalina.out and other log files? There will always be some log output...

Logs are attached.

used configuration is :

# enable the addon
simpleContentStores.enabled=true

# define the names of stores to configure
# (multiple stores can be listed in comma-separated fashion)
simpleContentStores.customStores=newSiteFileStore,siteRoutingStore
# use the store as the global standard (instead of default fileContentStore)
simpleContentStores.rootStore=siteRoutingStore

# define siteRoutingStore as a routing store
simpleContentStores.customStore.siteRoutingStore.type=siteRoutingStore
# store all non-routed content into the default file content store
simpleContentStores.customStore.siteRoutingStore.ref.fallbackStore=fileContentStore
simpleContentStores.customStore.siteRoutingStore.map.storeBySitePreset.ref.site-dashboard=newSiteFileStore

simpleContentStores.customStore.newSiteFileStore.type=standardFileStore
simpleContentStores.customStore.newSiteFileStore.value.rootDirectory=${dir.root}/newcontentstore
simpleContentStores.customStore.newSiteFileStore.value.moveStoresOnNodeMoveOrCopy=true
simpleContentStores.customStore.newSiteFileStore.value.useSiteFolderInGenericDirectories=true

logs.zip

Hello Axel,

Have you had some time to have a look at the configuration which causes some troubles for me and the logs I provided ?

Thanks in advance for your feedback and the help you can provide.

Kind Regards,

Arnaud.

Today I did have some time to set up something in a local 5.1.g system. I used the following configuration:

# enable the addon
simpleContentStores.enabled=true

# define the names of stores to configure
# (multiple stores can be listed in comma-separated fashion)
simpleContentStores.customStores=newSiteFileStore,siteRoutingStore
# use the store as the global standard (instead of default fileContentStore)
simpleContentStores.rootStore=siteRoutingStore

# define siteRoutingStore as a routing store
simpleContentStores.customStore.siteRoutingStore.type=siteRoutingStore
# store all non-routed content into the default file content store
simpleContentStores.customStore.siteRoutingStore.ref.fallbackStore=fileContentStore
simpleContentStores.customStore.siteRoutingStore.map.storeBySitePreset.ref.site-dashboard=newSiteFileStore

simpleContentStores.customStore.newSiteFileStore.type=siteRoutingFileStore
simpleContentStores.customStore.newSiteFileStore.value.protocol=new-store
simpleContentStores.customStore.newSiteFileStore.value.rootDirectory=${dir.root}/new-contentstore
simpleContentStores.customStore.newSiteFileStore.value.moveStoresOnNodeMoveOrCopy=true
simpleContentStores.customStore.newSiteFileStore.value.useSiteFolderInGenericDirectories=true

The main difference is the type of the newSiteFileStore - it must be the siteRoutingFileStore to have the sub-division per site. The server starts up just fine.

I juste tested the configuration you provided.
The server just starts fine also on my side (5.0.d version). Thanks.

However, if I add a document in an already existing site, then the document is added in the newSiteFileStore, and not in the "original" one.
It's not what I expected/understood..

To get the bahaviour I expect, I am obliged to write a specific line for all the existing sites, as the following one :
simpleContentStores.customStore.siteRoutingStore.map.storeBySite.ref.oldSiteName=fileContentStore

Is it normal ?

Thanks again for your help.

Or you can just set the storeBySitePreset to fileContentStore (or deleted the setting in the first place and don't have a storeBySitePreset at all, relying solely on the fallback) and only set storeBySite to newSiteFileStore for all the (new) sites you want to have in the new store.

OK, Thanks for your explanations.

I use your configuration, just adding a specific configuration for existing sites (simpleContentStores.customStore.siteRoutingStore.map.storeBySite.ref.oldSiteName=fileContentStore).
I prefer this, as it allows to get automatically a specific contentstore dir for every new site.

However, I continued my tests, and I get problems when copying a document from a site in the fileContentStore to a site in the newSiteFileStore (and vice versa).

If I try to copy a document from a site in the FileContentStore to a site in the newSiteFileStore, then I get an error ("failure when copying the document").
If I try to copy a document from a site in the newSiteFileStore to a site in the FileContentStore, then the document is copied, but it still belongs to the newSiteFileStore, when it should belong to the FileContentStore (as far as I understood, as I'm using the line simpleContentStores.customStore.newSiteFileStore.value.moveStoresOnNodeMoveOrCopy=true)
e.g. contentUrl=site-store://_scsp_2/site/testsite/2017/2/26/23/11/4... when it should be
contentUrl=store://2017/2/26/23/11/4...

Did I miss something, or is there a real issue ?

Thanks in advance for your help.

Regarding the error, can you please provide more details than just the message?

I can confirm the behaviour regarding the content URL and that indeed is not the intended behaviour in this case.

I checked the logs,, but I don't see any error.

I don't know what I might provide ...

Here is the screen copy :

image

You should be able to extract more information for the error via the browser developer tools when looking at the HTTP response.

I have implemented some corrections to the URL handling for copying/moving within the site routing file store. Additionally I would advise removing the moveStoresOnNodeMoveOrCopy setting from the newSiteFileStore and applying it to the siteRoutingStore. When move-capable stores are used it is better to enable the handling on the outer one (for its broader scope) than the inner one(s). In this case it will allow proper copy/move handling for content that is copied/moved out of any site, e.g. into the Repository "shared files".

I made new tests with your last delivery, and taking into account your advice.

The result is better than before, but I still get an error for a specific case.

If I copy/move docs between sites in the newSiteFileStore, everything works fine now (action ok, right contentUrl for the destination doc).

If I copy a doc from a site in the "original" contentstore (fileContentStore), for which I configured a specific line (eg. simpleContentStores.customStore.siteRoutingStore.map.storeBySite.ref.oldSiteName=fileContentStore), to a site in the newSiteFileStore, then the action and destination contenturl are also ok.

If I try to copy a doc from a site in the newSiteFileStore to the same site in the "original" contentstore (fileContentStore), then the action (copy or move) fails.

I'm not so familiar with the browser develop tools, but I get the following trace with the failed action :

{
"totalResults": 1,
"overallSuccess": false,
"successCount": 0,
"failureCount": 1,
"results":
[
{
"action": "copyFile",
"id": "0",
"type": "document",
"nodeRef": "workspace://SpacesStore/84e51451-92b7-489e-885f-74f773d633cf",
"success": false
}
]
}

Hoping it brings you the needed information so that you can understand and reproduce the problem.

Thanks for the help you can provide.

I can only reproduce the issue when the moveStoresOnNodeMoveOrCopy is set on the wrong level (on the newSiteFileStore instead of the siteRoutingStore).

If I try to copy a doc from a site in the newSiteFileStore to the same site in the "original" contentstore (fileContentStore), then the action (copy or move) fails.
You should not be able to do / force that. A site handled by the newSiteFileStore will have all new content managed by that store - copying into the "original" content store is not possible in any way.

Unfortunately, those document library actions are very annoyingly devoid of logging that may be activated - the same is true for the CopyService which handles the copy. So there is no way I can see to get more information for your issue.

I re-checked that the moveStoresOnNodeMoveOrCopy was set at the right level (siteRoutingStore). I confirm it's OK.
can you confirm the syntax I wrote is correct ?
simpleContentStores.customStore.siteRoutingStore.value.moveStoresOnNodeMoveOrCopy=true

Then, I see that my explanation was unclear.

When I say "If I try to copy a doc from a site in the newSiteFileStore to the same site in the "original" contentstore (fileContentStore), then the action (copy or move) fails."
I meant
"If I try to copy a doc from a site in the newSiteFileStore to a site in the "original" contentstore (fileContentStore), then the action (copy or move) fails.".

It's the same if I try to copy a doc from a site in the newSiteFileStore to anywhere in the companyhome.
As an example, I created a folder in Companyhome (named "Test"), with the needed rights. If I want to copy a doc from a "newSiteFileStore " site to this "test" folder, then the copy fails.

If I understand correctly your last sentence, there is no easy way to get logs which could help in finding the problem. And so it means that I cannot use the component for my case and my context, at least with this kind of configuration.
I have to find another configuration which would fulfill my requirements.

Thanks anyway fot the help you provided and that you might still provide.

Hello Axel,

I just made new tests, with an "official" 5.0.d community version, without any personal modification (except the simpleContentStore add-on installation).
And I still get the problem with a "usual" and simple use case.

Here is the context :

  • I create a new site named "entalp"
  • I create a new user named "nono"
  • I upload a document in the new entalp site (I checked afterwards that it is stored in the newSiteFileStore).
  • I try to copy the doc to the "nono" home folder, and then it fails.

In all the other copy use cases, it works fine (from user home to new site, from newsite1 to newsite2, ...)

The exact configuration (alfresco-global.properties) I use is the following :

### -----------------------------------------
### simple content store add-on configuration
# enable the addon
simpleContentStores.enabled=true

# define the names of stores to configure
# (multiple stores can be listed in comma-separated fashion)
simpleContentStores.customStores=newSiteFileStore,siteRoutingStore
# use the store as the global standard (instead of default fileContentStore)
simpleContentStores.rootStore=siteRoutingStore

# define siteRoutingStore as a routing store
simpleContentStores.customStore.siteRoutingStore.type=siteRoutingStore
# store all non-routed content into the default file content store
simpleContentStores.customStore.siteRoutingStore.ref.fallbackStore=fileContentStore
simpleContentStores.customStore.siteRoutingStore.value.moveStoresOnNodeMoveOrCopy=true

simpleContentStores.customStore.siteRoutingStore.map.storeBySitePreset.ref.site-dashboard=newSiteFileStore

simpleContentStores.customStore.newSiteFileStore.type=siteRoutingFileStore
simpleContentStores.customStore.newSiteFileStore.value.protocol=site-store
simpleContentStores.customStore.newSiteFileStore.value.rootDirectory=${dir.root}/sitecontentstore
simpleContentStores.customStore.newSiteFileStore.value.useSiteFolderInGenericDirectories=true

Could you help, please ?
Did I miss something in the configuration ?

Thanks in advance for your help.

Hello Axel,

Have you got some time to have a look at this issue ?

Thanks in advance for your feedback.

Hello Axel,

I made some new tests, and came to the following status :

  • If I comment (or remove) the line

simpleContentStores.customStore.siteRoutingStore.value.moveStoresOnNodeMoveOrCopy=true

then, I can copy a document from a "newsiteFileStore" to a user home (stored in the fileContentStore). The copied document is stored physically in the newSiteFileStore (which is OK, as the moveStoresOnNodeMoveOrCopy parameter isn't activated).

  • If I add again the same line, then the copy from the newSiteFileStore to the user home is impossible.

Hoping it can help, and that you would be able to help me for this issue.

Thanks in advance.

Today I finally managed to find some time to test this yet again. On Alfresco 5.1.g I cannot reproduce any of the issues reported. I don't have a 5.0.d setup anymore and I don't see what should be different in that version that would cause any problem.
I need to have some technical details about the issues to investigate this further, e.g. log excerpt or HTTP response bodies that actually show an error that can be traced / analysed.

Thanks for tour feedback.
Seeing that on a 5.1 there's apparently no problem, as I have to migrate to the Alfresco 5.2 asap, I will test the add-on with this version and I'll let you knox whether I still get a problem or not.

I just tested with the last 5.2 version (community version, without any modification), and the configuration of the add-on I use in the 5.0.d which works (except the problem we discussed about).

Alfresco doesn't start with this config.

I generated the amp with the last version of the package.

The related alfresco.log and config (part of the alfresco-global.properties) are joined to this post.

If I only put the first line simpleContentStores.enabled=true, Alfresco starts.

Is the add-on supposed to work with this version of Alfresco ?

Thanks in advance for the help you can provide.

alfresco_pb.zip

In Alfresco 5.2, a previously deprecated part of the ContentStore API has been removed. That is why it fails to start with that version (Error message: Caused by: java.lang.NoClassDefFoundError: org/alfresco/repo/content/ContentStore$ContentUrlHandler). This means that - in order to be compatible with Alfresco 5.2 - compatibility with every previous version of Alfresco needs to be dropped - the addon cannot be compatible to both 5.2/post-5.2 and pre-5.2 versions.

Created #7 for update and potential branching to support 5.2

Thanks for your quick feedback.

May I have an idea when you might have the needed time to make this update available ?

As I need this add-on and I have to update my Alfresco version, I will first update to the 5.1.g (as it seems to be compatible with the current version of the add-on), and will wait for the 5.2.

Thanks again for this very valuable add-on.

I just tested the add-on with the Alfresco 5.1.g (just installed the community version with the installer, Linux version, without any other modification).

The server starts right.
But I still get an error when I try to copy a doc from a site managed by the newSiteFileStore to a user home folder (as an example), as for the 5.0.d.
I don't understand why it works by you, and not in my context. Have you tested the exact same use case ?

Here is the context :

I create a new site named "entalp"
I create a new user named "nono"
I upload a document in the new entalp site (I checked afterwards that it is stored in the newSiteFileStore).
I try to copy the doc to the "nono" home folder, and then it fails.
(it works on the other side, from the user home to the new site)

The exact configuration (alfresco-global.properties) I use is the following :

### -----------------------------------------
### simple content store add-on configuration
# enable the addon
simpleContentStores.enabled=true

# define the names of stores to configure
# (multiple stores can be listed in comma-separated fashion)
simpleContentStores.customStores=newSiteFileStore,siteRoutingStore
# use the store as the global standard (instead of default fileContentStore)
simpleContentStores.rootStore=siteRoutingStore

# define siteRoutingStore as a routing store
simpleContentStores.customStore.siteRoutingStore.type=siteRoutingStore
# store all non-routed content into the default file content store
simpleContentStores.customStore.siteRoutingStore.ref.fallbackStore=fileContentStore
simpleContentStores.customStore.siteRoutingStore.value.moveStoresOnNodeMoveOrCopy=true

simpleContentStores.customStore.siteRoutingStore.map.storeBySitePreset.ref.site-dashboard=newSiteFileStore

simpleContentStores.customStore.newSiteFileStore.type=siteRoutingFileStore
simpleContentStores.customStore.newSiteFileStore.value.protocol=site-store
simpleContentStores.customStore.newSiteFileStore.value.rootDirectory=${dir.root}/sitecontentstore
simpleContentStores.customStore.newSiteFileStore.value.useSiteFolderInGenericDirectories=true

I did not use the exact same configuration since I already had other configurations / sites active in my system that would not have worked with that - but my setup was very similar to yours. Though apparently there was a small difference in runtime handling that kept me from seeing the error. This copy-problem should be fixed with aa09684

I tested the new version with Alfresco 5.1.

The copy now works for a doc from a site managed by the newSiteFileStore to a user home folder (as an example).

But the doc cannot be renamed if belonging to this site. When the doc is copied (or moved) to the user home, then it can be renamed.

Hi,
I want to encrypt content store and i have used configuration given by wiki.

simpleContentStores.enabled=true
simpleContentStores.customStores=myEncryptingStore
simpleContentStores.rootStore=myEncryptingStore
simpleContentStores.customStore.myEncryptingStore.type=myEncryptingStore
simpleContentStores.customStore.myEncryptingStore.type=encryptingFacadeStore
simpleContentStores.customStore.myEncryptingStore.ref.backingStore=fileContentStore
simpleContentStores.customStore.myEncryptingStore.value.keyStorePath=C://Program Files//Java//jdk1.8.0_91//bin//keystore.jks
simpleContentStores.customStore.myEncryptingStore.value.keyStoreType=JKS
simpleContentStores.customStore.myEncryptingStore.value.keyStorePassword=pass
simpleContentStores.customStore.myEncryptingStore.value.masterKeyAlias=pass
simpleContentStores.customStore.myEncryptingStore.value.masterKeyPassword=pass
simpleContentStores.customStore.myEncryptingStore.value.masterKeyStoreId=pass

I am using sdk2 and i have configured this property in alfresco-global.properties

When i start repo,it will generate contentstore and encrypt data.it is allow me to login but when i click on site it giving me error and error like this "Failure to load model object for path: alfresco/site-data/pages/site/swsdp/dashboard.xml
org.dom4j.DocumentException: Error on line 1 of document : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog."

untitled

I don't know this project enough, but a quick look on your configuration, this part called my attention:

simpleContentStores.customStore.myEncryptingStore.type=encryptingFacadeStore
simpleContentStores.customStore.myEncryptingStore.type=myEncryptingStore

Why do you have these duplicated lines?
Based on the configuration example, it seems the right one is the first line:

simpleContentStores.customStore.myEncryptingStore.type=encryptingFacadeStore

Remove the second line and try again.

still not working.
Here content is encrypted but during opening any page,it is showing error.

Thanks @douglascrp for your initial response. Ideally, this should have been a new issue, not continueing on an old issue (where I had given up on being able to reproduce the last alleged issue).
I don't know if I will have time before DevCon to try and reproduce the issue with encryption. One important information I need is the version of Alfresco being used. Since I have not yet tested with 6.0 there may be some hidden incompatibilities there - e.g. the encryption library may clash with a library that Alfresco now includes by default.

I am testing it with sdk2.

@SanjayBandhniya That does not answer the question. SDK 2 is just the version of the SDK you are using, but with SDK 2 you can use different versions of Alfresco (Alfresco have even published a blog post about how it can be used with Alfresco 6, even though official it was not designed to work with that).

Actually I am testing it with sdk2.
I have not installed that amps in alfresco because of issues.

Please provide the value of the "alfresco.version" property in your pom.xml file...

Version 5.1

Closing inactive old issue - if still relevant, I would ask to retest with more recent versions of SDK and current development version of this project.