Posts

Showing posts with the label Alfresco tutorials

Customizing the Share Header in Alfresco | Code Factory

Image
File : share-header.get.js ( <Alfresco> -> tomcat -> webapps -> share -> WEB-INF -> classes -> alfresco -> site-webscripts -> org -> alfresco -> share -> header ) Removing Menu Items : if (user.isAdmin) { widgetUtils.deleteObjectFromArray(model.jsonModel, 'id', 'HEADER_MY_FILES'); } This code remove 'My Files' from the header if user is Admin . Other widgets for removing menus from the header... widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER ADMIN CONSOLE"); widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_REPOSITORY"); widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_PEOPLE"); widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_TASKS"); widgetUtils.deleteObjectFromArray(model.jsonModel, "id", "HEADER_SITES_MENU"); widgetUtils.deleteObjectF...

Add a new page to Alfresco Share with link in Share Header | Code Factory

Image
The following steps are needed to add a Surf Page: Add a Surf Page definition file (XML) Add a Template Instance file (XML) Add a physical Template file (FTL) Add a properties file (.properties) - Optional but good practice Add Web Script(s) that fetches content to display (if you have page scoped regions and use an existing template) File :  helloworldhome.xml ( <Alfresco> -> tomcat -> shared -> classes -> alfresco -> web-extension -> site-data -> pages ) Hello World Home page.helloworldhome.title Hello World Home Description page.helloworldhome.description helloworldhome-three-column none File :  helloworldhome-three-column.xml (  <Alfresco> -> tomcat -> shared -> classes -> alfresco -> web-extension -> site-data -> template-instances ) org/alfresco/demo/helloworldhome File :  helloworldhome.ftl (  <Alfresco> -...

Creating a new theme in Alfresco | Code Factory

Image
Step1  : Go to <Alfresco> -> tomcat -> webapps -> share -> themes . Step2  : Copy the contents of an existing theme directory to the new theme directory.              Example : greenTheme to codeFactoryTheme Step3  : Open following files :              - presentation.css              - yui/assets/skin.css Step4  : Search for .yui-skin-greenTheme and replace with .yui-skin-codeFactoryTheme (In both files). Step5  : Save the files. Step6  : Create a new XML file in the <Alfresco> -> tomcat -> webapps -> share -> web-inf -> classes -> alfresco -> site-data -> themes then copy greenTheme.xml and rename codeFactoryTheme.xml Step7  : Open the codeFactoryTheme.xml file, change all instances of greenTheme to codeFactoryTheme, and then save the files...

Upload a file in Alfresco using java | Code Factory

Image
Download code and jars :  Link. Release 1.1.0 -> Commodity Packages -> Package -> OpenCMIS Client with dependencies File : AlfrescoFileUpload.java package com.alfresco; package com.alfresco; import java.io.ByteArrayInputStream; import java.io.InputStream; import java.math.BigInteger; import java.util.HashMap; import java.util.Map; import org.apache.chemistry.opencmis.client.api.Document; import org.apache.chemistry.opencmis.client.api.Folder; import org.apache.chemistry.opencmis.client.api.Session; import org.apache.chemistry.opencmis.client.api.SessionFactory; import org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl; import org.apache.chemistry.opencmis.commons.PropertyIds; import org.apache.chemistry.opencmis.commons.SessionParameter; import org.apache.chemistry.opencmis.commons.data.ContentStream; import org.apache.chemistry.opencmis.commons.enums.BindingType; import org.apache.chemistry.opencmis.commons.enums.VersioningState; import ...

Change Default Language In Alfresco | Code Factory

Image
Step1 : Download jars :  Link. Step2 : Copy these jar files into  C:\alfresco-community\tomcat\shared\lib  Folder. Step3 : Restart alfresco. Step4 : Now change browser language. Step5  : Done. Tags : Change default language in alfresco How to change languages in Alfresco 5.0.x Language support in alfresco How to change language of alfresco share