Fixed recursive initialization of OpenOfficeMetadataExtracter.

Fixed minor incorrect warning when XMLMetadataExtracter is active.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6279 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-07-17 16:30:44 +00:00
parent eccc9be0be
commit 91c962aae5
3 changed files with 11 additions and 7 deletions

View File

@@ -474,8 +474,8 @@ abstract public class AbstractMappingMetadataExtracter implements MetadataExtrac
}
}
// Were there any mappings
if (mapping.size() == 0)
// The configured mappings are empty, but there were default mappings
if (mapping.size() == 0 && defaultMapping.size() > 0)
{
logger.warn(
"There are no property mappings for the metadata extracter.\n" +

View File

@@ -102,17 +102,21 @@ public class OpenOfficeMetadataExtracter extends AbstractMappingMetadataExtracte
/**
* Initialises the bean by establishing an UNO connection
*/
@Override
public synchronized void init()
{
PropertyCheck.mandatory("OpenOfficeMetadataExtracter", "connection", connection);
// Base initialization
super.init();
// attempt a connection
connect();
if (isConnected())
// Only allow registration if the connection is good
if (!isConnected())
{
// Only register if the connection is available initially. Reconnections are only supported
// if the server is able to connection initially.
super.register();
// Reconnections are only supported if the server is able to connection initially.
super.setRegistry(null);
}
}