Merged DEV/SWIFT to HEAD

25927: (RECORD ONLY) Initial work on a Data List spreadsheet exporter. Needs more work in another iDay, but the basics are in place
   25938: (RECORD ONLY) Move the Data List Export Webscript to a dev branch for now
   25944: Added copyright notices
          Enhancements to SOLR remote api client library
          - get node text content transform status and exception
   25945: Removed superfluous file
   25952: ALF-7339: SOLR 020 Index track and build from SOLR
          - WIP - tracking transactions (accounting for holes), Adding and removing leaf docs with ID only, tracker status reporting via admin update handler
   25953: ALF-7339: SOLR 020 Index track and build from SOLR
          - WIP - compile fix
   25976: Query related build fixes (mixture of collateral damage from SOLR and OpenCMIS)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@28117 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2011-05-30 20:21:29 +00:00
parent 426b213db7
commit d68118af3a
9 changed files with 177 additions and 9 deletions

View File

@@ -1,3 +1,21 @@
/*
* Copyright (C) 2005-2011 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.repo.web.scripts.solr;
import java.io.IOException;
@@ -39,6 +57,9 @@ import org.springframework.extensions.webscripts.WebScriptResponse;
*/
public class GetNodeContent extends StreamContent
{
private static final String TRANSFORM_STATUS_HEADER = "X-Alfresco-transformStatus";
private static final String TRANSFORM_EXCEPTION_HEADER = "X-Alfresco-transformException";
private static final Log logger = LogFactory.getLog(GetNodeContent.class);
/**
@@ -110,9 +131,9 @@ public class GetNodeContent extends StreamContent
}
catch (Throwable e)
{
if (logger.isInfoEnabled())
if (logger.isWarnEnabled())
{
logger.info("Browser sent badly-formatted If-Modified-Since header: " + modifiedSinceStr);
logger.warn("Browser sent badly-formatted If-Modified-Since header: " + modifiedSinceStr);
}
}
@@ -151,14 +172,14 @@ public class GetNodeContent extends StreamContent
ContentTransformer transformer = contentService.getTransformer(reader.getMimetype(), MimetypeMap.MIMETYPE_TEXT_PLAIN);
if(transformer == null)
{
res.setHeader(TRANSFORM_STATUS_HEADER, "noTransform");
res.setStatus(HttpStatus.SC_NO_CONTENT);
return;
}
try
{
// TODO how to ensure UTF-8?
// TODO how to ensure UTF-8 in the transformed text?
transformer.transform(reader, writer);
}
catch (ContentIOException e)
@@ -181,11 +202,14 @@ public class GetNodeContent extends StreamContent
if(transformException != null)
{
res.setHeader("XAlfresco-transformException", transformException.getMessage());
res.setHeader(TRANSFORM_STATUS_HEADER, "failed");
res.setHeader(TRANSFORM_EXCEPTION_HEADER, transformException.getMessage());
res.setStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR);
}
else
{
res.setHeader(TRANSFORM_STATUS_HEADER, "ok");
res.setStatus(HttpStatus.SC_OK);
streamContentImpl(req, res, textReader, false, modified, String.valueOf(modified.getTime()), null);
}

View File

@@ -1,3 +1,21 @@
/*
* Copyright (C) 2005-2011 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.repo.web.scripts.solr;
import java.io.IOException;

View File

@@ -1,3 +1,21 @@
/*
* Copyright (C) 2005-2011 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.repo.web.scripts.solr;
import java.io.IOException;

View File

@@ -1,3 +1,21 @@
/*
* Copyright (C) 2005-2011 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.repo.web.scripts.solr;
import java.util.List;

View File

@@ -1,3 +1,21 @@
/*
* Copyright (C) 2005-2011 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.repo.web.scripts.solr;
import java.util.HashMap;

View File

@@ -1,3 +1,21 @@
/*
* Copyright (C) 2005-2011 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.repo.web.scripts.solr;
import java.io.IOException;

View File

@@ -1,3 +1,21 @@
/*
* Copyright (C) 2005-2011 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.repo.web.scripts.solr;
import java.io.Serializable;

View File

@@ -1,3 +1,21 @@
/*
* Copyright (C) 2005-2011 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.repo.web.scripts.solr;
import java.io.IOException;

View File

@@ -1,3 +1,21 @@
/*
* Copyright (C) 2005-2011 Alfresco Software Limited.
*
* This file is part of Alfresco
*
* Alfresco is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Alfresco is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
*/
package org.alfresco.repo.web.scripts.solr;
import java.io.PrintWriter;
@@ -630,7 +648,7 @@ public class SOLRWebScriptTest extends BaseWebScriptTest
});
}
/* public void testGetTransactions1() throws Exception
public void testGetTransactions1() throws Exception
{
long fromCommitTime = System.currentTimeMillis();
@@ -1028,7 +1046,7 @@ public class SOLRWebScriptTest extends BaseWebScriptTest
parameters.setTransactionIds(transactionIds);
parameters.setExcludeAspects(excludeAspects);
JSONArray nodes = getNodes(parameters, 0, 51);
}*/
}
public void testNodeMetaData() throws Exception
{
@@ -1079,7 +1097,7 @@ public class SOLRWebScriptTest extends BaseWebScriptTest
assertEquals("Path element " + i + " is incorrect", expectedPath, path);
}
}
/*
public void testNodeMetaDataManyNodes() throws Exception
{
long fromCommitTime = System.currentTimeMillis();
@@ -1127,7 +1145,7 @@ public class SOLRWebScriptTest extends BaseWebScriptTest
nodeDAO.clear();
nodesMetaData = getNodesMetaData(nodeIds, 0, 2001);
}*/
}
private boolean containsAspect(JSONArray aspectsArray, QName aspect) throws Exception
{