mvn archetype:generate -Dfilter=org.alfresco:
N.B. Hyphens are typically used in artifact IDs not in group IDs
- Check out models already deployed:
/alfresco/s/api/classes/<prefix>_<name>
- If you apply a hot edit to the
share-config-custom.xml
you need to refresh all your webscripts from/share/page/index
. - How get the repositoryId
curl -s -u admin:alfresco "http://<hostname>:<port>/alfresco/s/cmis" | grep repositoryId
- CMIS endpoint
/alfresco/service/api/cmis
- Enable debug log for JS-webscript: go to
tomcat/shared/classes/alfresco/extension/custom-log4j.properties
and change
log4j.logger.org.alfresco.repo.jscript=debug
log4j.logger.org.alfresco.repo.jscript.ScriptLogger=debug
tomcat/bin/startup.sh && tail -f tomcat/logs/catalina.out
tomcat/bin/shutdown.sh
- In Alfresco-Share navigate to
Repository>Data dictionary>Models
- Set property
model active = TRUE
- check
alfresco/service/api/classes/<prefix>_<name>
- Will not visible until the
share-config-custom.xml
will not be modified
java -jar /bin/alfresco-mmt.jar list tomcat\webapps\alfresco
java -jar /bin/alfresco-mmt.jar uninstall <moduleName> tomcat\webapps\alfresco
java -jar /bin/alfresco-mmt.jar install amps\mymodule-repo.amp tomcat\webapps\alfresco -force -nobackup -verbose
java -jar /bin/alfresco-mmt.jar install amps_share\mymodule-share.amp tomcat\webapps\share -force -nobackup -verbose
- List of JAVA running process:
ps -ef | grep java
- List of stopped process:
jobs
- Bring foreground process towards:
fg
netstat -an | grep alfresco | grep java | grep 8080
less
-> to search type:/wordtosearch
-> next match press:n
- List of commands you are allowed to do:
sudo su -l
sudo su - <user>
sudo -i
host <ip>
show ipgrep -rI --exclude-dir=test --exclude-dir=target "<wordtosearch>" .
find . -name "<wordtosearch>"
find . -name service.xml -exec du -h \{\} \; | sort -k1 -h
trova file mostra il size e ordina; -k1 sta per prima colonnachown <owner>:<group> <file>
du -sh <directory>
- out-of-the-box models in
alfresco/WEB-INF/lib/alfresco-repository-5.2.3.jar/alfresco/model
- out-of-the-box form controls in
share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/form/controls
Alfresco official doc reference
Summary:
- Enable surfbug:
/share/page/surfBugStatus
- Take notes about region-id, source-id and sub-component's id (the ID is the one after the hash)
- Put the xml definition under:
amp-share/src/main/amp/config/alfresco/web-extension/site-data/extensions
Alfresco official doc reference
res.addHeader("Content-Disposition", "inline; filename=" + fileName);
res.addHeader("Content-Disposition", "attachment; filename=" + fileName);
<img src="data:${mimetype};base64,${fileBase64}"/>
InputStream inputStream = contentService.getReader(nodeRef , ContentModel.PROP_CONTENT).getContentInputStream();
byte[] arrBuff = IOUtils.toByteArray(inputStream);
inputStream.close();
return Base64.encodeBase64URLSafeString(arrBuff);
QName nodeType = nodeService.getType(nodeRef);
FileFolderServiceType fileFolderNodeType = fileFolderService.getType(nodeType);
if (fileFolderService.exists(nodeRef) || !fileFolderNodeType.equals(FileFolderServiceType.FOLDER) ) {
throw new MyException(
HttpServletResponse.SC_BAD_REQUEST,
"Destination folder must be of type "+ContentModel.TYPE_FOLDER);
}