Daily Log for #alfresco IRC Channel

Alfresco discussion and collaboration. Stick around a few hours after asking a question.

Official support for Enterprise subscribers: support.alfresco.com.

Joining the Channel:

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.

Getting Help

More help is available in this list of resources.

Daily Log for #alfresco

2017-11-30 08:17:27 GMT <yreg> morning

2017-11-30 08:26:21 GMT <twen> 'morning

2017-11-30 10:38:32 GMT <fwu> hi all

2017-11-30 10:53:32 GMT <fwu> ppl, is there a good example concerning the check of existence of specific folders and the creation of folders when they dont exist (using Java)?

2017-11-30 10:54:13 GMT <fwu> do I really need to use search to see if a folder exists? Isnt there an object methof for accomplish this or somehting like that?

2017-11-30 10:54:23 GMT <angelborroy> https://github.com/jpotts/share-site-space-templates/blob/master/share-site-space-templates-repo/src/main/java/com/ecmarchitect/share/behavior/ShareDocumentLibraryFromTemplate.java

2017-11-30 10:54:24 GMT <alfbot> Title: share-site-space-templates/ShareDocumentLibraryFromTemplate.java at master · jpotts/share-site-space-templates · GitHub (at github.com)

2017-11-30 11:00:45 GMT <fwu> angelborroy, thank you! I will look at it.

2017-11-30 11:03:05 GMT <fwu> angelborroy, that example uses search and hardcoded path like this:

2017-11-30 11:03:07 GMT <fwu> "+PATH:\"/app:company_home/app:dictionary/app:site_folder_templates/*\"

2017-11-30 11:03:24 GMT <fwu> isnt a more agnostic way of getting a reference?

2017-11-30 11:03:47 GMT <angelborroy> define “agnostic”

2017-11-30 11:05:02 GMT <angelborroy> fwu ?

2017-11-30 11:05:12 GMT <fwu> angelborroy, something like this:

2017-11-30 11:05:40 GMT <fwu> object.getDir("dir name) -> search all nevels inside a specific context

2017-11-30 11:05:49 GMT <fwu> so that I dont need to hardcoded the path

2017-11-30 11:06:23 GMT <angelborroy> You need (at least) to hardcode the root path, right?

2017-11-30 11:06:45 GMT <angelborroy> to navigate by path, you can try https://dev.alfresco.com/resource/docs/java/org/alfresco/service/cmr/model/FileFolderService.html

2017-11-30 11:06:46 GMT <alfbot> Title: FileFolderService (Alfresco 5.3.a-SNAPSHOT API) (at dev.alfresco.com)

2017-11-30 11:06:54 GMT <fwu> ok, let me see

2017-11-30 11:07:06 GMT <_david_____> goog morning! is there any way to create folders from templates using scripts? (shell tools or maybe via curl and API?) I have some templates and have to create a whole bunch of base directories based on those

2017-11-30 11:07:08 GMT <angelborroy> or use a QUERY by PATH

2017-11-30 11:09:04 GMT <angelborroy> _david__ you can create nodes using REST API

2017-11-30 11:09:07 GMT <angelborroy> what else?

2017-11-30 11:09:53 GMT <fwu> angelborroy, in javascript I use a lot the object companyhome. How can I get it using java?

2017-11-30 11:10:12 GMT <angelborroy> “app:company_home”

2017-11-30 11:10:32 GMT <fwu> ok, using search for that, right?

2017-11-30 11:10:37 GMT <angelborroy> yep

2017-11-30 11:10:42 GMT <fwu> nice, thnak you

2017-11-30 11:14:20 GMT <AFaust> fwu: Please do not use luceneSearch, query etc. for this. Simply use selectNodes() with the XPath for it. Also note that you should not hard-code app:company_home. That name can technically be configured (though a lot of bad Alfresco code might break), and there is a property in alfresco-global.properties that you should inject for building the XPath to Company Home

2017-11-30 11:16:42 GMT <angelborroy> AFaust any sample of this?

2017-11-30 11:19:03 GMT <fwu> AFAust, that what I was looking for!

2017-11-30 11:19:09 GMT <AFaust> Of how to inject a property via Spring?

2017-11-30 11:19:10 GMT <_david_____> angelborroy, and can I create nodes using templates?

2017-11-30 11:19:34 GMT <fwu> selectNodes from a node reference?

2017-11-30 11:19:46 GMT <angelborroy> AFaust I’m assuming you are ironic, just trying to bookmark a sample to provide the people with

2017-11-30 11:20:18 GMT <angelborroy> _david____ No, you have to create it by yourself

2017-11-30 11:20:24 GMT <AFaust> Yeah, already looking up GitHub path to a default Alfresco bean as example. Wifi at customer is extremely slow today

2017-11-30 11:20:33 GMT <_david_____> angelborroy, ah, OK, thx!

2017-11-30 11:20:51 GMT <fwu> something like root.slectNodes (xpath) ... ?

2017-11-30 11:21:09 GMT <AFaust> fwu: On Java you do that via searchService.selectNodes

2017-11-30 11:21:56 GMT <fwu> ok, I will try that.

2017-11-30 11:22:14 GMT <fwu> I already have a reference to search services with the injected bean

2017-11-30 11:22:30 GMT <AFaust> angelborroy: https://github.com/Alfresco/alfresco-repository/blob/master/src/main/resources/alfresco/action-services-context.xml#L636

2017-11-30 11:22:31 GMT <alfbot> Title: alfresco-repository/action-services-context.xml at master · Alfresco/alfresco-repository · GitHub (at github.com)

2017-11-30 11:23:04 GMT <AFaust> angelborroy: crazy thing is, in the same file are many examples of how NOT to do it, i.e. the bad/breaking code I mentioned: https://github.com/Alfresco/alfresco-repository/blob/master/src/main/resources/alfresco/action-services-context.xml#L219

2017-11-30 11:23:05 GMT <alfbot> Title: alfresco-repository/action-services-context.xml at master · Alfresco/alfresco-repository · GitHub (at github.com)

2017-11-30 11:23:57 GMT <AFaust> It is so annoying to see how little Alfresco seems to invest in training internal developers to a common standard, i.e. with regards to standard patterns / practices that should always, under any circumstances, be complied with...

2017-11-30 11:25:27 GMT <fwu> yes, getting the companyhome like that seems better indeed

2017-11-30 11:26:01 GMT <fwu> in javascript Im more tolerant to hardcoding than in Java due to the compilation step...

2017-11-30 11:26:18 GMT <AFaust> Most (if not all) of the company home and dictionary related paths can be safely constructed from properties in alfresco-global.properties scope (predefined values here: https://github.com/Alfresco/alfresco-repository/blob/master/src/main/resources/alfresco/repository.properties#L443 )

2017-11-30 11:26:19 GMT <alfbot> Title: alfresco-repository/repository.properties at master · Alfresco/alfresco-repository · GitHub (at github.com)

2017-11-30 11:27:06 GMT <AFaust> Note that child names with spaces / special characters / digits at start are bad practice because they would require encoding for XPath...

2017-11-30 11:28:06 GMT <AFaust> The Imap Home, Imap Attachments and Scheduled Actions folders are decent examples of child names that cannot be used for XPath without encoding

2017-11-30 11:38:21 GMT <Popochon2> Hi

2017-11-30 11:40:53 GMT <Popochon2> may someone could help me :D Im trying to custom the css of seaarch page but i can not locate it. I know is in aikau, Where I can find the Aikau pages in share? or may u give me a suggest to what to do ?

2017-11-30 11:41:50 GMT <AFaust> There is no single CSS file for the Aikau search page. The effective CSS file is dynamically aggregated from all the widget module that are contained in the page, based on its JSON widget model

2017-11-30 11:42:56 GMT <Popochon2> My target is the header and footer

2017-11-30 11:43:08 GMT <AFaust> If you need to modify some global CSS parameters, you may want to look into the LESS variables of the theme. Otherwise you can also customise the individual widgets and set their style via the JSON config model

2017-11-30 11:44:21 GMT <AFaust> If you want to customise the header / footer (maybe not just for the search page), then you may want to look into writing an extension module with a customisation targeted at the share-header and share-footer web scripts...

2017-11-30 11:44:53 GMT <AFaust> If it is just for the search page, then again you can just modify / manipulate its JSON config model via a Surf extension module + customisation

2017-11-30 11:46:17 GMT <Popochon2> Where are located those files ? (im using mvn AIO february version)

2017-11-30 11:47:31 GMT <AFaust> "Where" is "what" located? If you are talking about extension module + customisation, then you need to create them as they are not pre-generated by the SDK...

2017-11-30 11:47:52 GMT <AFaust> With regards to the proper structure in an SDK project, someone else may have to help you. I do not use the SDK myself...

2017-11-30 11:48:27 GMT <AFaust> typically the extension module itself is defined in an XML within site-data/extensions, and the customisation files are part of the site-webscripts structure

2017-11-30 11:48:37 GMT <fwu> AFaust, using javascript after getting the companyhome I can make something like this:

2017-11-30 11:48:50 GMT <fwu> companyhome.childByNamePath(sPath)

2017-11-30 11:49:34 GMT <AFaust> If you want to have something similar in Java, use the FileFolderService...

2017-11-30 11:50:16 GMT <Popochon2> Thanks a lot for your help. now things are a little more clear, i will try to make some google searchs to find how todo what you said to me :D thx

2017-11-30 11:50:20 GMT <AFaust> I generally don't like path-lookups in any form except XPath.... way too brittle. If possible, I will use metadata-based lookups

2017-11-30 11:50:38 GMT <fwu> in Java the result node doesnt have this childbynamePath method

2017-11-30 11:50:39 GMT <AFaust> Popchon2: Before doing google searches, start with the documentation at docs.alfresco.com

2017-11-30 11:51:16 GMT <AFaust> fwu: No, of course not, because it is just an identifier on the Java API. You use other services with that identifier to perform more elaborate operations...

2017-11-30 11:51:33 GMT <AFaust> ..as I said, use the FileFolderService..

2017-11-30 11:51:51 GMT <fwu> ok, I will try it

2017-11-30 11:51:53 GMT <fwu> thank you

2017-11-30 11:52:28 GMT <Popochon2> yep, I was reading aikau tutorial :)

2017-11-30 11:53:06 GMT <Popochon2> and now im reading this http://docs.alfresco.com/5.2/concepts/dev-extensions-share-override-ootb-aikau-pages.html

2017-11-30 11:53:08 GMT <alfbot> Title: Modifying Out-of-the-box Aikau Pages | Alfresco Documentation (at docs.alfresco.com)

2017-11-30 12:25:43 GMT <_david_____> Weird problem: when I update a file or I try to add one file, I get this: Caused by: org.alfresco.scripts.ScriptException: 10300039 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/activity.post.json.js': 10300038 JSONObject["fileName"] not found.

2017-11-30 12:25:43 GMT <_david_____> at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:211)

2017-11-30 12:25:43 GMT <_david_____> at org.alfresco.repo.processor.ScriptServiceImpl.execute(ScriptServiceImpl.java:219)

2017-11-30 12:25:43 GMT <_david_____> at org.alfresco.repo.processor.ScriptServiceImpl.executeScript(ScriptServiceImpl.java:181)

2017-11-30 12:25:44 GMT <_david_____> at org.alfresco.repo.web.scripts.RepositoryScriptProcessor.executeScript(RepositoryScriptProcessor.java:109)

2017-11-30 12:25:47 GMT <_david_____> at org.springframework.extensions.webscripts.AbstractWebScript.executeScript(AbstractWebScript.java:1376)

2017-11-30 12:25:50 GMT <_david_____> at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:86)

2017-11-30 12:25:52 GMT <_david_____> ... 36 more

2017-11-30 12:25:54 GMT <_david_____> Caused by: org.alfresco.error.AlfrescoRuntimeException: 10300038 JSONObject["fileName"] not found.

2017-11-30 12:25:58 GMT <_david_____> at org.alfresco.repo.jscript.RhinoScriptProcessor.executeScriptImpl(RhinoScriptProcessor.java:525)

2017-11-30 12:26:00 GMT <_david_____> at org.alfresco.repo.jscript.RhinoScriptProcessor.execute(RhinoScriptProcessor.java:207)

2017-11-30 12:26:02 GMT <_david_____> ... 41 more

2017-11-30 12:26:04 GMT <_david_____> Caused by: org.json.JSONException: JSONObject["fileName"] not found.

2017-11-30 12:26:06 GMT <_david_____> at org.json.JSONObject.get(JSONObject.java:498)

2017-11-30 12:26:08 GMT <_david_____> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

2017-11-30 12:26:10 GMT <_david_____> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

2017-11-30 12:26:12 GMT <_david_____> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

2017-11-30 12:26:14 GMT <_david_____> at java.lang.reflect.Method.invoke(Method.java:498)

2017-11-30 12:59:30 GMT <douglascrp> morning

2017-11-30 13:04:57 GMT <yreg> Morning douglascrp

2017-11-30 13:05:11 GMT <yreg> is anyone here familiar with Alfresco setup with MariaDB

2017-11-30 13:05:25 GMT <douglascrp> yreg, I have a customer using it for 2 years, I think

2017-11-30 13:05:42 GMT <douglascrp> nothing special changed comparing with mysql

2017-11-30 13:05:53 GMT <douglascrp> same configuration, just works

2017-11-30 13:06:19 GMT <Loftux> Also have a number of customers that use MariaDB, no issues

2017-11-30 13:07:32 GMT <AFaust> yreg: Same as douglascrp and Loftux (though not for that long) - different driver, different JDBC URL, and that's about it...

2017-11-30 13:07:33 GMT <yreg> have you ever encountred this : java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction*

2017-11-30 13:07:56 GMT <douglascrp> yreg, not that I can remember

2017-11-30 13:08:11 GMT <yreg> when you try to execute some logic inside a retrying transaction helper

2017-11-30 13:08:47 GMT <yreg> (I am trying to create folder structure concurrently and I want to make sure there is no data loss)

2017-11-30 13:09:03 GMT <yreg> and the same code that runs without issues on PGSQL

2017-11-30 13:09:17 GMT <yreg> just hangs for a while than throw that exception on MariaDB

2017-11-30 13:09:42 GMT <yreg> I will try to use a couple more drivers to see if that makes a difference

2017-11-30 13:10:59 GMT <douglascrp> I believe I saw that same problem before in the community... someone was facing the same kind of problem

2017-11-30 13:11:20 GMT <douglascrp> AFaust was helping there if I am not wrong

2017-11-30 13:13:17 GMT <AFaust> Well, in that discussion within the community platform, the person in question had a very broken setup with regards to nested transactions. That was bound to cause issues...

2017-11-30 13:13:28 GMT <AFaust> I mean "code setup" in this case

2017-11-30 13:13:36 GMT <yreg> douglascrp, just realized that Alfresco supports 10.1 and we were using 10.3 so that might be it

2017-11-30 13:13:47 GMT <yreg> will try to switch back as well

2017-11-30 13:14:28 GMT <douglascrp> AFaust, tks

2017-11-30 13:15:45 GMT <yreg> AFaust, in this case we are just reusing the concepts from http://beecon.buzz/2017/assets/files/FL01/Alexey%20Vasyukov%20-%20Alfresco%20repo%20under%20concurrent%20write%20load.pdf

2017-11-30 13:16:09 GMT <yreg> so I don't consider that to bne a broken setup with regards to nested exceptions

2017-11-30 13:31:34 GMT <yreg> nothing works even with the supported version/driver

2017-11-30 13:48:44 GMT <jebla> I have noticed that nodeService.getChildAssocs(siteNodeRef) return inconsistent results. Only sometimes does it return all sites as expected. Anybody have experienced something similar?

2017-11-30 14:35:12 GMT <yreg> jebla, how many sites do you have ?

2017-11-30 14:36:55 GMT * AFaust groans (again) about (some of the) stupidities in APS...

2017-11-30 14:38:30 GMT <yreg> AFaust, I heard that

2017-11-30 14:38:35 GMT <AFaust> If I have a task and during its creation set a specific variable of that task to a default value x, then why the heck doesn't the form display that value in the corresponding field? Already checked DB state, field name (for possible typo)...

2017-11-30 14:39:05 GMT <yreg> AFaust, missing data binding /

2017-11-30 14:39:07 GMT <yreg> ?

2017-11-30 14:39:45 GMT <AFaust> There is no need for any data binding... The start form stores its values into the variables table without any binding, so read should be the same...

2017-11-30 14:39:58 GMT <jebla> yreg, we have just below 8000

2017-11-30 14:40:35 GMT * AFaust groans even louder...

2017-11-30 14:41:13 GMT <AFaust> yreg: Answer to my question: In APS - other than in Alfresco embedded Activiti - the form doesn't actually show / work with the variables of the task. Instead, all variables are stored on the execution level.

2017-11-30 14:41:16 GMT <AFaust> What bollocks...

2017-11-30 14:45:40 GMT <yreg> AFaust, grin

2017-11-30 14:46:15 GMT <AFaust> Woohooo... and of course this kind of behaviour leads to information leakage. Regardless of the fields configured in the form for a specific user / task, the HTTP response for the details includes ALL variables of the execution, i.e. previous user inputs and other stuff stored in variables...

2017-11-30 14:46:16 GMT <yreg> jebla, you will need to paginate 1000 elements at the time, I bet that your issue is with max acl check time or something

2017-11-30 14:47:46 GMT <jebla> yreg, thanks for the hint

2017-11-30 14:48:25 GMT *** angelborroy_ is now known as angelborroy

2017-11-30 15:24:27 GMT <fwu> ppl, if I do this: FileInfo docInf = ffs.resolveNamePath(companyHomeNode, pathElements);

2017-11-30 15:25:17 GMT <fwu> and the apth is not found, shouldnt docInf retuns null or something like that. In this moment the isntruction is throwing an error.

End of Daily Log

The other logs are at http://esplins.org/hash_alfresco