Powered By Blogger

Friday, October 28, 2011

Liferay and Alfresco Doclib integration

Alfresco uses org.springframework.extensions.webscripts.connector.HttpConnector to talk with
Alfresco. This has the hardcoded value
headers.put("X-Alfresco-Remote-User", user);

Since it is hardcoded,if we change the value of th eheader then the authentication will not be respected.

So change the code to fir the your custom external key CTUSER defined in your external file.






alfresco-noauth
Alfresco - unauthenticated access
Access to Alfresco Repository WebScripts that do not require authentication
alfresco
http://localhost:8080/alfresco/s
none



alfresco-feed
Alfresco Feed
Alfresco Feed - supports basic HTTP authentication
http
http://localhost:8080/alfresco/s
true
user



alfrescoCookie
Alfresco Connector
Connects to an Alfresco instance using cookie-based authentication
org.springframework.extensions.webscripts.connector.AlfrescoConnector



alfresco
Alfresco - user access
Access to Alfresco Repository WebScripts that require user authentication
alfrescoCookie
http://localhost:8080/alfresco/wcs
user
true





Thursday, October 27, 2011

Finding the pid of the server running in alfresco

halfwd01:#cd /opt/alfresco/
halfwd01:#find . -name '*.pid'
./tomcat/temp/catalina.pid
halfwd01:#cat ./tomcat/temp/catalina.pid
16789
halfd01:#ps -elf|grep java
0 S patil 14735 14413 0 77 0 - 15296 - 12:24 pts/3 00:00:00 grep java
0 S alfresco 16789 1 5 84 0 - 522368 futex_ Oct26 ? 01:15:21 /opt/alfresco/java/bin/java -Djava.util.logging.config.file=/opt/alfresco/tomcat/conf/logging.properties -Xms512m -Xmx1024m -Xss1024k -XX:MaxPermSize=256m -XX:NewSize=256m -XX:+UseConcMarkSweepGC -Dalfresco.home=/opt/alfresco -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/opt/alfresco/tomcat/endorsed -classpath /opt/alfresco/tomcat/bin/bootstrap.jar -Dcatalina.base=/opt/alfresco/tomcat -Dcatalina.home=/opt/alfresco/tomcat -Djava.io.tmpdir=/opt/alfresco/tomcat/temp org.apache.catalina.startup.Bootstrap start
halfd01:#

Thursday, October 20, 2011

ldap sync in Alfresco





org.alfresco.repo.security.sync.UserRegistrySynchronizerJob







${synchronization.synchronizeChangesOnly}






${synchronization.import.cron}








From here it calls




ChainingUserRegistrySynchronizer.java has a method by name


syncWithPlugin

private void syncWithPlugin(final String zone, UserRegistry userRegistry, boolean forceUpdate,
boolean allowDeletions, boolean splitTxns, final Set visitedZoneIds, final Set allZoneIds)



It has

final BatchProcessor personProcessor = new BatchProcessor(zone
+ " User Creation and Association", this.transactionService.getRetryingTransactionHelper(),
userRegistry.getPersons(lastModified), this.workerThreads, 10, this.applicationEventPublisher,

userRegistry.getPersons(lastModified)


It calls LDAPUSerRegistry

/*
* (non-Javadoc)
* @see org.alfresco.repo.security.sync.UserRegistry#getPersons(java.util.Date)
*/
public Collection getPersons(Date modifiedSince)
{
return new PersonCollection(modifiedSince);
}


which in turn calls PersonCollection. The PersonCollection has the constructor to initialize the query


PersonIterator has the next to get the users from the system

private NodeDescription fetchNext() throws NamingException
{
boolean readyForNextPage;
do
{
readyForNextPage = this.searchResults == null;
while (!readyForNextPage && this.searchResults.hasMore())
{
SearchResult result = this.searchResults.next();
Attributes attributes = result.getAttributes();
Attribute uidAttribute = attributes.get(LDAPUserRegistry.this.userIdAttributeName);
if (uidAttribute == null)
{
if (LDAPUserRegistry.this.errorOnMissingUID)
{
throw new AlfrescoRuntimeException(
"User returned by user search does not have mandatory user id attribute "
+ attributes);
}
else
{
LDAPUserRegistry.logger
.warn("User returned by user search does not have mandatory user id attribute "
+ attributes);
continue;
}
}
String uid = (String) uidAttribute.get(0);

if (this.uids.contains(uid))
{
LDAPUserRegistry.logger
.warn("Duplicate uid found - there will be more than one person object for this user - "
+ uid);
}

this.uids.add(uid);

if (LDAPUserRegistry.logger.isDebugEnabled())
{
LDAPUserRegistry.logger.debug("Adding user for " + uid);
}

// Apply the mapped properties to the node description
return mapToNode(LDAPUserRegistry.this.personAttributeMapping,
LDAPUserRegistry.this.personAttributeDefaults, result);
}

// Examine the paged results control response for an indication that another page is available
if (!readyForNextPage)
{
readyForNextPage = LDAPUserRegistry.this.ldapInitialContextFactory.hasNextPage(this.ctx,
LDAPUserRegistry.this.queryBatchSize);
}

// Fetch the next page if there is one
if (readyForNextPage)
{
this.searchResults = this.ctx.search(LDAPUserRegistry.this.userSearchBase,
PersonCollection.this.query, this.userSearchCtls);
}
}
while (readyForNextPage);
this.searchResults.close();
this.searchResults = null;
this.ctx.close();
this.ctx = null;
return null;
}


Monday, October 17, 2011

Open Office Trouble shooting

http://wiki.knowledgetree.org/Troubleshooting_OpenOffice.org_Service

testing the service

ps -aux | grep soffice

Tuesday, October 11, 2011

Cron jobs

30 1 * * * --- every day 1:30


http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html


http://www.abunchofutils.com/utils/developer/cron-expression-helper/
http://www.cronmaker.com/

0 0 23 1/1 * ? * --- Every day night 11'o clock

Thursday, October 6, 2011

WebServices for Alfresco

http://wiki.alfresco.com/wiki/IngresTutorial_Alfresco_Web_Service_API_for_Java

org.alfresco.webservice.test.ContentServiceSystemTest

It has more explainations on the content upload through stream