Alfresco discussion and collaboration. Stick around a few hours after asking a question.
Official support for Enterprise subscribers: support.alfresco.com.
Join in the conversation by getting an IRC client and connecting to #alfresco at Freenode. Our you can use the IRC web chat.
More information about the channel is in the wiki.
More help is available in this list of resources.
2017-06-24 09:28:27 GMT <Ayub> is there an sdk to use for customizing alfresco community edition ?
2017-06-24 09:28:55 GMT <Ayub> tried to follow steps listed at http://docs.alfresco.com/5.1/tasks/alfresco-sdk-tutorials-all-in-one-archetype.html but seeing errors
2017-06-24 09:28:57 GMT <alfbot> Title: Creating an All-in-One (AIO) project (WARs) | Alfresco Documentation (at docs.alfresco.com)
2017-06-24 15:18:20 GMT <AFaust> ~later tell yreg: Ok, after checking with binduwavel that he didn't take the "Best Helper" BeeCon mug by accident we have realised that there must have been a misprint with the mugs that you did not notice. We each have a "Best Addon" one at home... Or did you pick the wrong mug when handing them out?
2017-06-24 15:18:20 GMT <alfbot> AFaust: The operation succeeded.
2017-06-24 17:16:14 GMT <fwu> hi all!
2017-06-24 17:18:55 GMT <fwu> AFaust are you there?
2017-06-24 17:19:13 GMT <AFaust> Yep
2017-06-24 17:19:20 GMT <fwu> nice!
2017-06-24 17:19:36 GMT <fwu> Im struggling with the java code to create a new document version.
2017-06-24 17:19:37 GMT <AFaust> ...until my Docker SOLR 4 setup works, then it is off for dinner
2017-06-24 17:20:02 GMT <fwu> I have the code working to wrtie a new document to a new location
2017-06-24 17:20:18 GMT <fwu> but when im trying to write it as a new version, it seems it doesnt work
2017-06-24 17:20:41 GMT <fwu> the relevant code:
2017-06-24 17:20:45 GMT <fwu> CheckOutCheckInService checkOutCheckInService = serviceRegistry.getCheckOutCheckInService(); NodeRef oNodeRefcheckedOut = checkOutCheckInService.checkout(oNodeRef);
2017-06-24 17:21:51 GMT <fwu> I then load the file with docx4j
2017-06-24 17:22:08 GMT <fwu> do some stuff and save the result to a memory stream
2017-06-24 17:22:21 GMT <fwu> exactly as when Im saving the file to a new location
2017-06-24 17:22:24 GMT <fwu> then
2017-06-24 17:22:40 GMT <fwu> I do this:
2017-06-24 17:22:44 GMT <fwu> writer = ffs.getWriter(oNodeRefcheckedOut); writer.setEncoding("UTF-8"); writer.setMimetype(WORD_FILE_MIMETYPE); writer.putContent(contentStream);
2017-06-24 17:23:14 GMT <fwu> I get a writer from the checkeout noderef and put content which is my new contentstream
2017-06-24 17:23:45 GMT <fwu> the contentstream is an inputstream from my dox4j file
2017-06-24 17:24:15 GMT <fwu> i dont get an error, but when I go to alfresco and look at the file, there is no new version there
2017-06-24 17:24:29 GMT <fwu> I still have one version only
2017-06-24 17:24:29 GMT <AFaust> A checked out node will not get a new version.
2017-06-24 17:24:43 GMT <fwu> I need a checkin?
2017-06-24 17:24:50 GMT <AFaust> Or more specifically, the working copy you are working with won't get one
2017-06-24 17:24:57 GMT <fwu> but it doesnt seem to be locked...
2017-06-24 17:25:06 GMT <AFaust> Yes, the versions are only maintained on the main document and you need to do a checkin
2017-06-24 17:25:17 GMT <AFaust> The original is locked, the working copy is not locked
2017-06-24 17:25:33 GMT <AFaust> (which I find is an error in the design of Alfresco)
2017-06-24 17:25:48 GMT <fwu> ok, so
2017-06-24 17:25:51 GMT <fwu> when I do this:
2017-06-24 17:26:04 GMT <fwu> writer = ffs.getWriter(oNodeRefcheckedOut);
2017-06-24 17:26:08 GMT <fwu> is this making the checkout?
2017-06-24 17:26:18 GMT <fwu> getting a writer form the node....
2017-06-24 17:26:22 GMT <fwu> from
2017-06-24 17:26:46 GMT <fwu> forget...
2017-06-24 17:26:54 GMT <fwu> the checkout was made previously!
2017-06-24 17:27:31 GMT <fwu> then I need to do something like this: heckOutCheckInService.checkin(oNodeRefcheckedOut ); ?
2017-06-24 17:28:22 GMT <fwu> AFaust, but when im checkingout, I dont need to say to where I want to check out as I thought I would need... does, where is the checkedout document?
2017-06-24 17:28:56 GMT <AFaust> As I mentioned the last time, the default is to checkout the working copy into the same folder as the original
2017-06-24 17:30:19 GMT <fwu> im looking in that folder. I can see the document is blocked indeed
2017-06-24 17:30:26 GMT <fwu> but I only see one document there!
2017-06-24 17:31:48 GMT <fwu> im browsing in the folder strucuture
2017-06-24 17:31:51 GMT <fwu> structure
2017-06-24 17:31:59 GMT <fwu> maybe it is hidden?
2017-06-24 17:35:03 GMT <AFaust> If you are using the Share document library / repository view then it will automatically do some auto-magic hiding of the original / working copy depending on the current user
2017-06-24 17:40:20 GMT <fwu> im using the admin
2017-06-24 17:40:33 GMT <fwu> but I was expecting something like that indeed
2017-06-24 17:40:48 GMT <fwu> im also not expecting to get that copy while searching
2017-06-24 17:41:45 GMT <fwu> AFaust, I found this code:
2017-06-24 17:41:46 GMT <fwu> checkOutCheckInService.checkin(workingCopy, versionProperties);
2017-06-24 17:42:05 GMT <fwu> i already have a versionproerties, but what is the workingcopy?
2017-06-24 17:42:44 GMT <fwu> hmm
2017-06-24 17:42:48 GMT <fwu> maybe it is my oNodeRefcheckedOut
2017-06-24 17:42:51 GMT <fwu> it makes sense
2017-06-24 17:42:59 GMT <AFaust> working copy is your working copy node... the one that is the result of the checkout operation
2017-06-24 17:43:11 GMT <fwu> yes, it seems it is this!
2017-06-24 17:43:20 GMT <fwu> thank you! I will test the code
2017-06-24 18:21:48 GMT <fwu> AFaust, I can now change the document, but it remains with version 1.0
2017-06-24 18:21:53 GMT <fwu> strange...
2017-06-24 18:22:15 GMT <fwu> I now the file is chnaged, because I did a merge in a field on that docx
2017-06-24 18:22:22 GMT <fwu> I can see the dynamic value on it
2017-06-24 18:22:27 GMT <fwu> but the version remians 1.0
2017-06-24 18:23:22 GMT <fwu> I did this
2017-06-24 18:23:40 GMT <fwu> Map<String, Serializable> versionProperties = new HashMap<String, Serializable>(); versionProperties.put(Version.PROP_DESCRIPTION, "testingggg"); versionProperties.put(VersionModel.PROP_VERSION_TYPE, VersionType.MAJOR); checkOutCheckInService.checkin(oNodeRefcheckedOut, versionProperties);
2017-06-24 18:24:06 GMT <fwu> i used a version major so I would expect 2.0
2017-06-24 18:43:04 GMT <AFaust> Was the document versionable before?
2017-06-24 18:43:33 GMT <AFaust> In order to ensure versioning works correctly it is often a good idea to add the cm:versionable aspect as soon as possible
2017-06-24 19:11:28 GMT <fwu> AFaust, i just uploaded and then set a custom model
2017-06-24 19:11:49 GMT <fwu> I believe it is versionable. If not, how was I able to chnage it?
2017-06-24 19:12:11 GMT <fwu> when a document is not versionable I can change it, although I can set a different version?
2017-06-24 19:12:54 GMT <fwu> Also, Im able to version it manually
2017-06-24 19:15:18 GMT <AFaust> apply the versionable aspect
2017-06-24 19:16:03 GMT <AFaust> and yes, you can technically change a versionable document without creating a new version (if auto-version is not enabled for the node)
The other logs are at http://esplins.org/hash_alfresco