Archive for alfresco

Alfresco Tips

Setup CIFS server
-Add to PATH: %ALFRESCO_HOME%\bin
-File-servers-custom.xml: Change port 8080 to correct port used
-Enable NetBios over TCP/IP (TCP/IP Properties -> Advanced -> WINS -> Enable NetBIOS over TCP/IP)

Upgrade
-In custom-repository.properties set db.schema.update=true
-Remove alf_bootstrap_lock table if you see
org.alfresco.error.AlfrescoRuntimeException:
A previous schema upgrade failed.
Revert to the original database before attempting the upgrade again.

Rebuild Lucene indexes
-Remove all lucene indexes
-Add to custom-repository.properties: index.recovery.mode=FULL

Clean content store
-In content-services-context.xml, set protectDays to 1

 
<bean id="baseContentStoreCleaner"
  class="org.alfresco.repo.content
    .cleanup.ContentStoreCleaner"
    abstract="true">
<property name="protectDays" >
     <value>1</value>
  </property>
</bean>
 

Install Alfresco

Prepare database (in this case a SQL Server 2000 database)

  • Create a database named alfresco
  • Create a database user named alfresco and make it owner of the newly created alfresco database

Prepare Alfresco

  • Download Alfresco: alfresco-community-tomcat-2.9.0B.zip
  • Unzip content to D:\Alfresco
  • Install JDBC driver
    • SQLServer 2005:
      Copy sqljdbc.jar to \tomcat\common\lib
      Copy sqljdbc_auth.dll to \system32
    • SQLServer 2000:
      Copy jtds-1.2.1.jar to to \tomcat\common\lib
  • In alfresco\tomcat\shared\classes\alfresco\extension directory
  • Edit custom-hibernate-dialect.properties to use SQLServer dialect:
    hibernate.dialect= org.alfresco.repo.domain
    .hibernate.dialect.AlfrescoSQLServerDialect
  • Edit custom-repository.properties to use alfresco database
    SQLServer 2005:
    db.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
    db.url=jdbc:sqlserver://localhost; DatabaseName=alfresco; IntegratedSecurity=true
    #db.url=jdbc:sqlserver://localhost; DatabaseName=alfresco; User Id=alfresco;Password=alfresco;

    SQLServer 2000:
    dir.root=D:/Alfresco/Data
    db.username=alfresco
    db.password=alfresco
    db.pool.initial=10
    db.pool.max=100
    db.driver=net.sourceforge.jtds.jdbc.Driver
    db.url=jdbc:jtds:sqlserver://localhost/alfresco

  • Edit alfresco/tomcat/conf/server.xml and change port from 8080 to 80
  • Edit service.bat to increase jvm memory: --JvmMs 512 --JvmMx 1024
  • Install alfresco as a windows service: tomcat\bin\service install Alfresco

Simple Search Custom Aspect

Add to web-client-config-custom.xml

 
<simple-search-additional-attributes>
<qname>
{http://www.alfresco.org/model/content/1.0}description
</qname>
<qname>
{http://www.alfresco.org/model/content/1.0}title
</qname>
<qname>
{http://www.mycompany.com/model/content/1.0}customID
</qname>
</simple-search-additional-attributes>
 

Extend Date Picker

Modify alfresco\webapps\alfresco\WEB-INF\faces-config-beans.xml file.
The following example sets date picker year back to 1799

 
<managed-bean>
  <description>
     Bean that generates a date picker component
  </description>
  <managed-bean-name>
    DatePickerGenerator
  </managed-bean-name>
  <managed-bean-class>
    org.alfresco.web.bean.generator
    .DatePickerGenerator
  </managed-bean-class>
  <managed-bean-scope>request</managed-bean-scope>
  <managed-property>
<property-name>startYear</property-name>
     <value>2008</value>
  </managed-property>
  <managed-property>
<property-name>yearCount</property-name>
     <value>210</value>
  </managed-property>
  <!--
  <managed-property>

<property-name>initialiseIfNull</property-name>
     <value>false</value>
  </managed-property>
  -->
</managed-bean>