mirror of
https://github.com/Alfresco/SearchServices.git
synced 2025-10-08 14:51:20 +00:00
Merge branch 'feature/SEARCH-9_create_build_artifacts' into 'master'
Feature/search 9 create build artifacts We are building jars artifacts in alfresco-solr/target which are then used in the packaging/target distribution. How does it look? See merge request !3
This commit is contained in:
@@ -6,8 +6,6 @@ Git:
|
|||||||
|
|
||||||
git clone https://gitlab.alfresco.com/search_discovery/solr.git
|
git clone https://gitlab.alfresco.com/search_discovery/solr.git
|
||||||
|
|
||||||
cd solr
|
|
||||||
|
|
||||||
### Use Maven
|
### Use Maven
|
||||||
1. Build
|
1. Build
|
||||||
|
|
||||||
@@ -19,10 +17,9 @@ mvn clean install
|
|||||||
To build the docker image, first run the maven build then
|
To build the docker image, first run the maven build then
|
||||||
```
|
```
|
||||||
cd packaging
|
cd packaging
|
||||||
./build.sh
|
./buildAndTest.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
### License
|
### License
|
||||||
Copyright (C) 2016 Alfresco Software Limited
|
Copyright (C) 2016 Alfresco Software Limited
|
||||||
|
|
||||||
|
@@ -10,7 +10,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-solr-parent</artifactId>
|
<artifactId>alfresco-solr-parent</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>6.0-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
@@ -206,6 +206,23 @@
|
|||||||
</excludes>
|
</excludes>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>create-test-jar</id>
|
||||||
|
<goals>
|
||||||
|
<goal>test-jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>attach-sources</id>
|
||||||
|
<goals>
|
||||||
|
<goal>jar</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
@@ -1,212 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!--
|
|
||||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
||||||
contributor license agreements. See the NOTICE file distributed with
|
|
||||||
this work for additional information regarding copyright ownership.
|
|
||||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
||||||
(the "License"); you may not use this file except in compliance with
|
|
||||||
the License. You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
-->
|
|
||||||
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
|
||||||
version="2.5"
|
|
||||||
metadata-complete="true"
|
|
||||||
>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Uncomment if you are trying to use a Resin version before 3.0.19.
|
|
||||||
Their XML implementation isn't entirely compatible with Xerces.
|
|
||||||
Below are the implementations to use with Sun's JVM.
|
|
||||||
<system-property javax.xml.xpath.XPathFactory=
|
|
||||||
"com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl"/>
|
|
||||||
<system-property javax.xml.parsers.DocumentBuilderFactory=
|
|
||||||
"com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"/>
|
|
||||||
<system-property javax.xml.parsers.SAXParserFactory=
|
|
||||||
"com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl"/>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- People who want to hardcode their "Solr Home" directly into the
|
|
||||||
WAR File can set the JNDI property here...
|
|
||||||
-->
|
|
||||||
<!--
|
|
||||||
<env-entry>
|
|
||||||
<env-entry-name>solr/home</env-entry-name>
|
|
||||||
<env-entry-value>/put/your/solr/home/here</env-entry-value>
|
|
||||||
<env-entry-type>java.lang.String</env-entry-type>
|
|
||||||
</env-entry>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<filter>
|
|
||||||
<filter-name>X509AuthFilter</filter-name>
|
|
||||||
<filter-class>org.alfresco.solr.servlet.Solr4X509ServletFilter</filter-class>
|
|
||||||
<!--
|
|
||||||
Uncomment to validate a specifc cert for a specific URL.
|
|
||||||
<init-param>
|
|
||||||
<param-name>cert-contains</param-name>
|
|
||||||
<param-value>CN=Alfresco Repository,OU=Unknown,O=Alfresco Software Ltd.,L=Maidenhead,ST=UK,C=GB</param-value>
|
|
||||||
</init-param>
|
|
||||||
-->
|
|
||||||
</filter>
|
|
||||||
|
|
||||||
<filter-mapping>
|
|
||||||
<filter-name>X509AuthFilter</filter-name>
|
|
||||||
<url-pattern>/*</url-pattern>
|
|
||||||
</filter-mapping>
|
|
||||||
|
|
||||||
<!-- Any path (name) registered in solrconfig.xml will be sent to that filter -->
|
|
||||||
<filter>
|
|
||||||
<filter-name>SolrRequestFilter</filter-name>
|
|
||||||
<filter-class>org.apache.solr.servlet.SolrDispatchFilter</filter-class>
|
|
||||||
<!-- If you are wiring Solr into a larger web application which controls
|
|
||||||
the web context root, you will probably want to mount Solr under
|
|
||||||
a path prefix (app.war with /app/solr mounted into it, for example).
|
|
||||||
You will need to put this prefix in front of the SolrDispatchFilter
|
|
||||||
url-pattern mapping too (/solr/*), and also on any paths for
|
|
||||||
legacy Solr servlet mappings you may be using.
|
|
||||||
For the Admin UI to work properly in a path-prefixed configuration,
|
|
||||||
the admin folder containing the resources needs to be under the app context root
|
|
||||||
named to match the path-prefix. For example:
|
|
||||||
|
|
||||||
.war
|
|
||||||
xxx
|
|
||||||
js
|
|
||||||
main.js
|
|
||||||
-->
|
|
||||||
<!--
|
|
||||||
<init-param>
|
|
||||||
<param-name>path-prefix</param-name>
|
|
||||||
<param-value>/xxx</param-value>
|
|
||||||
</init-param>
|
|
||||||
-->
|
|
||||||
</filter>
|
|
||||||
|
|
||||||
<filter-mapping>
|
|
||||||
<!--
|
|
||||||
NOTE: When using multicore, /admin JSP URLs with a core specified
|
|
||||||
such as /solr/coreName/admin/stats.jsp get forwarded by a
|
|
||||||
RequestDispatcher to /solr/admin/stats.jsp with the specified core
|
|
||||||
put into request scope keyed as "org.apache.solr.SolrCore".
|
|
||||||
|
|
||||||
It is unnecessary, and potentially problematic, to have the SolrDispatchFilter
|
|
||||||
configured to also filter on forwards. Do not configure
|
|
||||||
this dispatcher as <dispatcher>FORWARD</dispatcher>.
|
|
||||||
-->
|
|
||||||
<filter-name>SolrRequestFilter</filter-name>
|
|
||||||
<url-pattern>/*</url-pattern>
|
|
||||||
</filter-mapping>
|
|
||||||
|
|
||||||
<servlet>
|
|
||||||
<servlet-name>Zookeeper</servlet-name>
|
|
||||||
<servlet-class>org.apache.solr.servlet.ZookeeperInfoServlet</servlet-class>
|
|
||||||
</servlet>
|
|
||||||
|
|
||||||
<servlet>
|
|
||||||
<servlet-name>LoadAdminUI</servlet-name>
|
|
||||||
<servlet-class>org.apache.solr.servlet.LoadAdminUiServlet</servlet-class>
|
|
||||||
</servlet>
|
|
||||||
|
|
||||||
<!-- Remove in Solr 5.0 -->
|
|
||||||
<!-- This sends SC_MOVED_PERMANENTLY (301) for resources that changed in 4.0 -->
|
|
||||||
<servlet>
|
|
||||||
<servlet-name>RedirectOldAdminUI</servlet-name>
|
|
||||||
<servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class>
|
|
||||||
<init-param>
|
|
||||||
<param-name>destination</param-name>
|
|
||||||
<param-value>${context}/#/</param-value>
|
|
||||||
</init-param>
|
|
||||||
</servlet>
|
|
||||||
|
|
||||||
<servlet>
|
|
||||||
<servlet-name>RedirectOldZookeeper</servlet-name>
|
|
||||||
<servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class>
|
|
||||||
<init-param>
|
|
||||||
<param-name>destination</param-name>
|
|
||||||
<param-value>${context}/zookeeper</param-value>
|
|
||||||
</init-param>
|
|
||||||
</servlet>
|
|
||||||
|
|
||||||
<servlet>
|
|
||||||
<servlet-name>RedirectLogging</servlet-name>
|
|
||||||
<servlet-class>org.apache.solr.servlet.RedirectServlet</servlet-class>
|
|
||||||
<init-param>
|
|
||||||
<param-name>destination</param-name>
|
|
||||||
<param-value>${context}/#/~logging</param-value>
|
|
||||||
</init-param>
|
|
||||||
</servlet>
|
|
||||||
|
|
||||||
<servlet>
|
|
||||||
<servlet-name>SolrRestApi</servlet-name>
|
|
||||||
<servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
|
|
||||||
<init-param>
|
|
||||||
<param-name>org.restlet.application</param-name>
|
|
||||||
<param-value>org.apache.solr.rest.SolrSchemaRestApi</param-value>
|
|
||||||
</init-param>
|
|
||||||
</servlet>
|
|
||||||
|
|
||||||
<servlet>
|
|
||||||
<servlet-name>SolrConfigRestApi</servlet-name>
|
|
||||||
<servlet-class>org.restlet.ext.servlet.ServerServlet</servlet-class>
|
|
||||||
<init-param>
|
|
||||||
<param-name>org.restlet.application</param-name>
|
|
||||||
<param-value>org.apache.solr.rest.SolrConfigRestApi</param-value>
|
|
||||||
</init-param>
|
|
||||||
</servlet>
|
|
||||||
|
|
||||||
<servlet-mapping>
|
|
||||||
<servlet-name>RedirectOldAdminUI</servlet-name>
|
|
||||||
<url-pattern>/admin/</url-pattern>
|
|
||||||
</servlet-mapping>
|
|
||||||
<servlet-mapping>
|
|
||||||
<servlet-name>RedirectOldAdminUI</servlet-name>
|
|
||||||
<url-pattern>/admin</url-pattern>
|
|
||||||
</servlet-mapping>
|
|
||||||
<servlet-mapping>
|
|
||||||
<servlet-name>RedirectOldZookeeper</servlet-name>
|
|
||||||
<url-pattern>/zookeeper.jsp</url-pattern>
|
|
||||||
</servlet-mapping>
|
|
||||||
<servlet-mapping>
|
|
||||||
<servlet-name>RedirectLogging</servlet-name>
|
|
||||||
<url-pattern>/logging</url-pattern>
|
|
||||||
</servlet-mapping>
|
|
||||||
|
|
||||||
<!-- Servlet Mapping -->
|
|
||||||
<servlet-mapping>
|
|
||||||
<servlet-name>Zookeeper</servlet-name>
|
|
||||||
<url-pattern>/zookeeper</url-pattern>
|
|
||||||
</servlet-mapping>
|
|
||||||
|
|
||||||
<servlet-mapping>
|
|
||||||
<servlet-name>LoadAdminUI</servlet-name>
|
|
||||||
<url-pattern>/admin.html</url-pattern>
|
|
||||||
</servlet-mapping>
|
|
||||||
|
|
||||||
<servlet-mapping>
|
|
||||||
<servlet-name>SolrRestApi</servlet-name>
|
|
||||||
<url-pattern>/schema/*</url-pattern>
|
|
||||||
</servlet-mapping>
|
|
||||||
|
|
||||||
<servlet-mapping>
|
|
||||||
<servlet-name>SolrConfigRestApi</servlet-name>
|
|
||||||
<url-pattern>/config/*</url-pattern>
|
|
||||||
</servlet-mapping>
|
|
||||||
|
|
||||||
<mime-mapping>
|
|
||||||
<extension>.xsl</extension>
|
|
||||||
<!-- per http://www.w3.org/TR/2006/PR-xslt20-20061121/ -->
|
|
||||||
<mime-type>application/xslt+xml</mime-type>
|
|
||||||
</mime-mapping>
|
|
||||||
|
|
||||||
<welcome-file-list>
|
|
||||||
<welcome-file>admin.html</welcome-file>
|
|
||||||
</welcome-file-list>
|
|
||||||
|
|
||||||
</web-app>
|
|
@@ -1,462 +0,0 @@
|
|||||||
/*
|
|
||||||
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
||||||
contributor license agreements. See the NOTICE file distributed with
|
|
||||||
this work for additional information regarding copyright ownership.
|
|
||||||
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
||||||
(the "License"); you may not use this file except in compliance with
|
|
||||||
the License. You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
var core_basepath = null;
|
|
||||||
var content_element = null;
|
|
||||||
var selected_type = null;
|
|
||||||
var context_path = null;
|
|
||||||
var active_context = null;
|
|
||||||
var changes = null;
|
|
||||||
var reference_xml = null;
|
|
||||||
|
|
||||||
var compute_plugin_data = function( response, changeset )
|
|
||||||
{
|
|
||||||
var types = [];
|
|
||||||
var sort_table = {};
|
|
||||||
var plugin_data = {};
|
|
||||||
|
|
||||||
var types_obj = {};
|
|
||||||
var plugin_key = null;
|
|
||||||
|
|
||||||
changes = { count : {}, list : {} }
|
|
||||||
|
|
||||||
for( var i = 0; i < response['solr-mbeans'].length; i++ )
|
|
||||||
{
|
|
||||||
if( !( i % 2 ) )
|
|
||||||
{
|
|
||||||
plugin_key = response['solr-mbeans'][i];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
plugin_data[plugin_key] = response['solr-mbeans'][i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for( var key in plugin_data )
|
|
||||||
{
|
|
||||||
sort_table[key] = {
|
|
||||||
url : [],
|
|
||||||
component : [],
|
|
||||||
handler : []
|
|
||||||
};
|
|
||||||
for( var part_key in plugin_data[key] )
|
|
||||||
{
|
|
||||||
if( plugin_data[key][part_key]['_changed_'] )
|
|
||||||
{
|
|
||||||
delete plugin_data[key][part_key]['_changed_'];
|
|
||||||
|
|
||||||
changes.count[key] = changes.count[key] || 0;
|
|
||||||
changes.count[key]++;
|
|
||||||
|
|
||||||
changes.list[key] = changes.list[key] || {};
|
|
||||||
changes.list[key][part_key] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( 0 < part_key.indexOf( '.' ) )
|
|
||||||
{
|
|
||||||
types_obj[key] = true;
|
|
||||||
sort_table[key]['handler'].push( part_key );
|
|
||||||
}
|
|
||||||
else if( 0 === part_key.indexOf( '/' ) )
|
|
||||||
{
|
|
||||||
types_obj[key] = true;
|
|
||||||
sort_table[key]['url'].push( part_key );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
types_obj[key] = true;
|
|
||||||
sort_table[key]['component'].push( part_key );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for( var type in types_obj )
|
|
||||||
{
|
|
||||||
types.push( type );
|
|
||||||
}
|
|
||||||
types.sort();
|
|
||||||
|
|
||||||
return {
|
|
||||||
'plugin_data' : plugin_data,
|
|
||||||
'sort_table' : sort_table,
|
|
||||||
'types' : types
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
var render_plugin_data = function( plugin_data, plugin_sort, types )
|
|
||||||
{
|
|
||||||
var frame_element = $( '#frame', content_element );
|
|
||||||
var navigation_element = $( '#navigation ul', content_element );
|
|
||||||
|
|
||||||
var navigation_content = [];
|
|
||||||
for( var i = 0; i < types.length; i++ )
|
|
||||||
{
|
|
||||||
var type_url = active_context.params.splat[0] + '/' + active_context.params.splat[1] + '/' + types[i].toLowerCase();
|
|
||||||
|
|
||||||
var navigation_markup = '<li class="' + types[i].toLowerCase().esc() + '">' +
|
|
||||||
'<a href="#/' + type_url + '" rel="' + types[i].esc() + '">' + types[i].esc();
|
|
||||||
|
|
||||||
if( changes.count[types[i]] )
|
|
||||||
{
|
|
||||||
navigation_markup += ' <span>' + changes.count[types[i]].esc() + '</span>';
|
|
||||||
}
|
|
||||||
|
|
||||||
navigation_markup += '</a>' +
|
|
||||||
'</li>';
|
|
||||||
|
|
||||||
navigation_content.push( navigation_markup );
|
|
||||||
}
|
|
||||||
|
|
||||||
navigation_content.push( '<li class="PLUGINCHANGES"><a href="#">Watch Changes</a></li>' );
|
|
||||||
navigation_content.push( '<li class="RELOAD"><a href="#" onClick="window.location.reload()">Refresh Values</a></li>' );
|
|
||||||
|
|
||||||
navigation_element
|
|
||||||
.html( navigation_content.join( "\n" ) );
|
|
||||||
|
|
||||||
$( '.PLUGINCHANGES a', navigation_element )
|
|
||||||
.die( 'click' )
|
|
||||||
.live
|
|
||||||
(
|
|
||||||
'click',
|
|
||||||
function( event )
|
|
||||||
{
|
|
||||||
load_reference_xml();
|
|
||||||
|
|
||||||
changes = { count : {}, list : {} }
|
|
||||||
$( 'a > span', navigation_element ).remove();
|
|
||||||
$( '.entry.changed', frame_element ).removeClass( 'changed' );
|
|
||||||
|
|
||||||
$.blockUI
|
|
||||||
(
|
|
||||||
{
|
|
||||||
message: $('#recording'),
|
|
||||||
css: { width: '450px' }
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
$( '#recording button' )
|
|
||||||
.die( 'click' )
|
|
||||||
.live
|
|
||||||
(
|
|
||||||
'click',
|
|
||||||
function( event )
|
|
||||||
{
|
|
||||||
$.ajax
|
|
||||||
(
|
|
||||||
{
|
|
||||||
type: 'POST',
|
|
||||||
url: core_basepath + '/admin/mbeans',
|
|
||||||
dataType : 'json',
|
|
||||||
data: {
|
|
||||||
'stats': 'true',
|
|
||||||
'wt': 'json',
|
|
||||||
'diff': 'true',
|
|
||||||
'all': 'true',
|
|
||||||
'stream.body': reference_xml
|
|
||||||
},
|
|
||||||
success : function( response, text_status, xhr )
|
|
||||||
{
|
|
||||||
load_reference_xml();
|
|
||||||
|
|
||||||
app.plugin_data = compute_plugin_data( response );
|
|
||||||
render_plugin_data( app.plugin_data.plugin_data, app.plugin_data.sort_table, app.plugin_data.types );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
$.unblockUI();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
$( 'a[href="' + context_path + '"]', navigation_element )
|
|
||||||
.parent().addClass( 'current' );
|
|
||||||
|
|
||||||
var content = '<ul>';
|
|
||||||
for( var sort_key in plugin_sort[selected_type] )
|
|
||||||
{
|
|
||||||
plugin_sort[selected_type][sort_key].sort();
|
|
||||||
var plugin_type_length = plugin_sort[selected_type][sort_key].length;
|
|
||||||
|
|
||||||
for( var i = 0; i < plugin_type_length; i++ )
|
|
||||||
{
|
|
||||||
var bean = plugin_sort[selected_type][sort_key][i];
|
|
||||||
var classes = [ 'entry' ];
|
|
||||||
|
|
||||||
if( changes.list[selected_type] && changes.list[selected_type][bean] )
|
|
||||||
{
|
|
||||||
classes.push( 'changed' );
|
|
||||||
}
|
|
||||||
|
|
||||||
content += '<li class="' + classes.join( ' ' ) + '">' + "\n";
|
|
||||||
content += '<a href="' + context_path + '?entry=' + bean.esc() + '" data-bean="' + bean.esc() + '">';
|
|
||||||
content += '<span>' + bean.esc() + '</span>';
|
|
||||||
content += '</a>' + "\n";
|
|
||||||
content += '<ul class="detail">' + "\n";
|
|
||||||
|
|
||||||
var details = plugin_data[selected_type][ plugin_sort[selected_type][sort_key][i] ];
|
|
||||||
for( var detail_key in details )
|
|
||||||
{
|
|
||||||
if( 'stats' !== detail_key )
|
|
||||||
{
|
|
||||||
var detail_value = details[detail_key];
|
|
||||||
|
|
||||||
if( 'description' === detail_key )
|
|
||||||
{
|
|
||||||
// Link component list to their MBeans page
|
|
||||||
if(detail_value.match(/^Search using components: /)) {
|
|
||||||
var idx = detail_value.indexOf(':');
|
|
||||||
var url = '#/'+active_context.params.splat[0]+'/plugins/other?entry=';
|
|
||||||
var tmp = 'Search using components:<ul>';
|
|
||||||
$.each(detail_value.substr(idx+1).split(","), function(index, value) {
|
|
||||||
value = $.trim(value);
|
|
||||||
tmp += '<li><a href="'+url+value+'" class="linker">'+value+"</a></li>";
|
|
||||||
});
|
|
||||||
tmp += "</ul>";
|
|
||||||
detail_value = tmp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
content += '<li><dl class="clearfix">' + "\n";
|
|
||||||
content += '<dt>' + detail_key.esc() + ':</dt>' + "\n";
|
|
||||||
if($.isArray(detail_value)) {
|
|
||||||
$.each(detail_value, function(index, value) {
|
|
||||||
content += '<dd>' + value.esc() + '</dd>' + "\n";
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
content += '<dd>' + new String( detail_value ).esc() + '</dd>' + "\n";
|
|
||||||
}
|
|
||||||
content += '</dl></li>' + "\n";
|
|
||||||
}
|
|
||||||
else if( 'stats' === detail_key && details[detail_key] )
|
|
||||||
{
|
|
||||||
content += '<li class="stats clearfix">' + "\n";
|
|
||||||
content += '<span>' + detail_key.esc() + ':</span>' + "\n";
|
|
||||||
content += '<ul>' + "\n";
|
|
||||||
|
|
||||||
for( var stats_key in details[detail_key] )
|
|
||||||
{
|
|
||||||
var stats_value = new String( details[detail_key][stats_key] );
|
|
||||||
stats_value = stats_value.replace( /([\(@])/g, '$1​' );
|
|
||||||
|
|
||||||
content += '<li><dl class="clearfix">' + "\n";
|
|
||||||
content += '<dt>' + stats_key.esc() + ':</dt>' + "\n";
|
|
||||||
content += '<dd>' + stats_value.esc() + '</dd>' + "\n";
|
|
||||||
content += '</dl></li>' + "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
content += '</ul></li>' + "\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
content += '</ul>' + "\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
content += '</ul>' + "\n";
|
|
||||||
|
|
||||||
frame_element
|
|
||||||
.html( content );
|
|
||||||
|
|
||||||
|
|
||||||
var path = active_context.path.split( '?entry=' );
|
|
||||||
var entries = ( path[1] || '' ).split( ',' );
|
|
||||||
|
|
||||||
var entry_count = entries.length;
|
|
||||||
for( var i = 0; i < entry_count; i++ )
|
|
||||||
{
|
|
||||||
$( 'a[data-bean="' + entries[i] + '"]', frame_element )
|
|
||||||
.parent().addClass( 'expanded' );
|
|
||||||
}
|
|
||||||
|
|
||||||
$( 'a', frame_element )
|
|
||||||
.off( 'click' )
|
|
||||||
.on
|
|
||||||
(
|
|
||||||
'click',
|
|
||||||
function( event )
|
|
||||||
{
|
|
||||||
var self = $( this );
|
|
||||||
var bean = self.data( 'bean' );
|
|
||||||
|
|
||||||
var split = '?entry=';
|
|
||||||
var path = active_context.path.split( split );
|
|
||||||
var entry = ( path[1] || '' );
|
|
||||||
|
|
||||||
var regex = new RegExp( bean.replace( /\//g, '\\/' ) + '(,|$)' );
|
|
||||||
var match = regex.test( entry );
|
|
||||||
|
|
||||||
var url = path[0] + split;
|
|
||||||
|
|
||||||
url += match
|
|
||||||
? entry.replace( regex, '' )
|
|
||||||
: entry + ',' + bean;
|
|
||||||
|
|
||||||
url = url.replace( /=,/, '=' );
|
|
||||||
url = url.replace( /,$/, '' );
|
|
||||||
url = url.replace( /\?entry=$/, '' );
|
|
||||||
|
|
||||||
active_context.redirect( url );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// Try to make links for anything with http (but leave the rest alone)
|
|
||||||
$( '.detail dd' ).each(function(index) {
|
|
||||||
var txt = $(this).html();
|
|
||||||
if(txt.indexOf("http") >= 0) {
|
|
||||||
$(this).linker({
|
|
||||||
className : 'linker'
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Add invisible whitespace after each slash
|
|
||||||
$( '.detail a.linker' ).each(function(index) {
|
|
||||||
$(this).html( $(this).html().replace( /\//g, '/​' ) );
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$( '.entry', frame_element )
|
|
||||||
.each
|
|
||||||
(
|
|
||||||
function( i, entry )
|
|
||||||
{
|
|
||||||
$( '.detail > li', entry ).not( '.stats' ).filter( ':even' )
|
|
||||||
.addClass( 'odd' );
|
|
||||||
|
|
||||||
$( '.stats li:odd', entry )
|
|
||||||
.addClass( 'odd' );
|
|
||||||
}
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
var load_reference_xml = function()
|
|
||||||
{
|
|
||||||
$.ajax
|
|
||||||
(
|
|
||||||
{
|
|
||||||
type: 'GET',
|
|
||||||
url: core_basepath + '/admin/mbeans?stats=true&wt=xml',
|
|
||||||
dataType : 'text',
|
|
||||||
success: function( data )
|
|
||||||
{
|
|
||||||
reference_xml = data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
sammy.bind
|
|
||||||
(
|
|
||||||
'plugins_load',
|
|
||||||
function( event, params )
|
|
||||||
{
|
|
||||||
var callback = function()
|
|
||||||
{
|
|
||||||
params.callback( app.plugin_data.plugin_data, app.plugin_data.sort_table, app.plugin_data.types );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( app.plugin_data )
|
|
||||||
{
|
|
||||||
callback( app.plugin_data );
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$.ajax
|
|
||||||
(
|
|
||||||
{
|
|
||||||
url : core_basepath + '/admin/mbeans?stats=true&wt=json',
|
|
||||||
dataType : 'json',
|
|
||||||
beforeSend : function( xhr, settings )
|
|
||||||
{
|
|
||||||
},
|
|
||||||
success : function( response, text_status, xhr )
|
|
||||||
{
|
|
||||||
app.plugin_data = compute_plugin_data( response );
|
|
||||||
|
|
||||||
$.get
|
|
||||||
(
|
|
||||||
'tpl/plugins.html',
|
|
||||||
function( template )
|
|
||||||
{
|
|
||||||
$( '#content' )
|
|
||||||
.html( template );
|
|
||||||
|
|
||||||
callback( app.plugin_data );
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
error : function( xhr, text_status, error_thrown)
|
|
||||||
{
|
|
||||||
},
|
|
||||||
complete : function( xhr, text_status )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// #/:core/plugins/$type
|
|
||||||
sammy.get
|
|
||||||
(
|
|
||||||
new RegExp( app.core_regex_base + '\\/(plugins)\\/(\\w+)$' ),
|
|
||||||
function( context )
|
|
||||||
{
|
|
||||||
core_basepath = this.active_core.attr( 'data-basepath' );
|
|
||||||
content_element = $( '#content' );
|
|
||||||
selected_type = context.params.splat[2].toUpperCase();
|
|
||||||
context_path = context.path.split( '?' ).shift();
|
|
||||||
active_context = context;
|
|
||||||
|
|
||||||
sammy.trigger
|
|
||||||
(
|
|
||||||
'plugins_load',
|
|
||||||
{
|
|
||||||
active_core : this.active_core,
|
|
||||||
callback : render_plugin_data
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// #/:core/plugins
|
|
||||||
sammy.get
|
|
||||||
(
|
|
||||||
new RegExp( app.core_regex_base + '\\/(plugins)$' ),
|
|
||||||
function( context )
|
|
||||||
{
|
|
||||||
core_basepath = this.active_core.attr( 'data-basepath' );
|
|
||||||
delete app.plugin_data;
|
|
||||||
|
|
||||||
sammy.trigger
|
|
||||||
(
|
|
||||||
'plugins_load',
|
|
||||||
{
|
|
||||||
active_core : this.active_core,
|
|
||||||
callback : function( plugin_data, plugin_sort, types )
|
|
||||||
{
|
|
||||||
context.redirect( context.path + '/' + types[0].toLowerCase() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
@@ -5,6 +5,9 @@ MAINTAINER Gethin James, gethin.james@alfresco.com
|
|||||||
|
|
||||||
ENV SOLR_ZIP target/alfresco-solr-distribution-*.zip
|
ENV SOLR_ZIP target/alfresco-solr-distribution-*.zip
|
||||||
ENV DIST_DIR /opt/alfresco-solr
|
ENV DIST_DIR /opt/alfresco-solr
|
||||||
|
ENV SOLR_SOLR_CONTENT_DIR $DIST_DIR/data/content
|
||||||
|
ENV SOLR_SOLR_MODEL_DIR $DIST_DIR/data/alfrescoModels
|
||||||
|
ENV SOLR_INCLUDE $DIST_DIR/solr.in.sh
|
||||||
|
|
||||||
RUN groupadd -r solr && useradd -r -g solr -s /bin/bash solr
|
RUN groupadd -r solr && useradd -r -g solr -s /bin/bash solr
|
||||||
|
|
||||||
@@ -14,9 +17,17 @@ RUN apt-get update && apt-get install -y \
|
|||||||
--no-install-recommends && rm -r /var/lib/apt/lists/*
|
--no-install-recommends && rm -r /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY $SOLR_ZIP $DIST_DIR/
|
COPY $SOLR_ZIP $DIST_DIR/
|
||||||
|
COPY target/test-classes/solr.in.sh $DIST_DIR/
|
||||||
WORKDIR $DIST_DIR
|
WORKDIR $DIST_DIR
|
||||||
|
|
||||||
RUN unzip *.zip -d $DIST_DIR/ && rm *.zip && chown -R solr:solr $DIST_DIR/*
|
RUN unzip *.zip -d $DIST_DIR/ && rm *.zip && \
|
||||||
|
mkdir -p $SOLR_SOLR_CONTENT_DIR && \
|
||||||
|
mkdir -p $DIST_DIR/data/index && \
|
||||||
|
mv $DIST_DIR/solrhome/alfrescoModels $DIST_DIR/data/ && \
|
||||||
|
mv $DIST_DIR/solrhome $DIST_DIR/data/ && \
|
||||||
|
chown -R solr:solr $DIST_DIR
|
||||||
|
|
||||||
|
VOLUME /opt/alfresco-solr/data
|
||||||
EXPOSE 8983
|
EXPOSE 8983
|
||||||
USER solr
|
USER solr
|
||||||
CMD [ "/opt/alfresco-solr/solr/bin/solr", "start", "-f" ]
|
CMD [ "/opt/alfresco-solr/solr/bin/solr", "start", "-f" ]
|
||||||
|
@@ -26,8 +26,10 @@ if ! docker inspect "$dockerImage" &> /dev/null; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# running tests
|
# running tests
|
||||||
docker run --rm "$dockerImage" [ -d /opt/alfresco-solr/data ] || (echo "Data dir does not exist" && exit 1)
|
docker run --rm "$dockerImage" [ -d /opt/alfresco-solr/solr ] || (echo "solr dir does not exist" && exit 1)
|
||||||
docker run --rm "$dockerImage" [ -e /opt/alfresco-solr/solrhome/conf/shared.properties ] || (echo "shared.properties does not exist" && exit 1)
|
docker run --rm "$dockerImage" [ -d /opt/alfresco-solr/data/content ] || (echo "content dir does not exist" && exit 1)
|
||||||
|
docker run --rm "$dockerImage" [ -d /opt/alfresco-solr/data/alfrescoModels ] || (echo "alfrescoModels dir does not exist" && exit 1)
|
||||||
|
docker run --rm "$dockerImage" [ -e /opt/alfresco-solr/data/solrhome/conf/shared.properties ] || (echo "shared.properties does not exist" && exit 1)
|
||||||
docker run --rm "$dockerImage" /opt/alfresco-solr/solr/bin/solr start
|
docker run --rm "$dockerImage" /opt/alfresco-solr/solr/bin/solr start
|
||||||
|
|
||||||
echo "Publishing $dockerImage..."
|
echo "Publishing $dockerImage..."
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
version: '2'
|
version: '2'
|
||||||
services:
|
services:
|
||||||
repo:
|
repo:
|
||||||
image: dockerreg.alfresco.com/platform-only
|
image: dockerreg.alfresco.com/platform-only:latest
|
||||||
environment:
|
environment:
|
||||||
JAVA_OPTS : "-Ddb.url=jdbc:postgresql://database/alfresco -Dsolr.secureComms=none"
|
JAVA_OPTS : "-Ddb.url=jdbc:postgresql://database/alfresco -Dsolr.secureComms=none -Dsolr.useDynamicShardRegistration=true"
|
||||||
depends_on:
|
depends_on:
|
||||||
- database
|
- database
|
||||||
ports:
|
ports:
|
||||||
@@ -13,11 +13,12 @@ services:
|
|||||||
image: dockerreg.alfresco.com/alfresco-solr:master-latest
|
image: dockerreg.alfresco.com/alfresco-solr:master-latest
|
||||||
command: [ "/opt/alfresco-solr/solr/bin/solr", "start", "-f", "-a", "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044"]
|
command: [ "/opt/alfresco-solr/solr/bin/solr", "start", "-f", "-a", "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044"]
|
||||||
environment:
|
environment:
|
||||||
SOLR_PROXY_HOST: solr6
|
#Solr needs to know how to call Alfresco
|
||||||
SOLR_PROXY_BASEURL: solr
|
|
||||||
SOLR_ALFRESCO_HOST: repo
|
SOLR_ALFRESCO_HOST: repo
|
||||||
# SOLR_ALFRESCO_PORT: 8080
|
SOLR_ALFRESCO_PORT: 8080
|
||||||
# "alfresco.baseUrl",
|
#Alfresco (admin console) needs to know how to call solr
|
||||||
|
SOLR_PROXY_HOST: localhost
|
||||||
|
SOLR_PROXY_PORT: 8083
|
||||||
ports:
|
ports:
|
||||||
- "8083:8983"
|
- "8083:8983"
|
||||||
- "1044:1044"
|
- "1044:1044"
|
||||||
@@ -26,4 +27,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: alfresco
|
POSTGRES_USER: alfresco
|
||||||
POSTGRES_PASSWORD: alfresco
|
POSTGRES_PASSWORD: alfresco
|
||||||
POSTGRES_DB: alfresco
|
POSTGRES_DB: alfresco
|
||||||
|
|
||||||
|
|
||||||
|
#In the Index Server Shard Management Admin console the index server is: localhost:8083/solr
|
@@ -2,7 +2,6 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-solr-distribution</artifactId>
|
<artifactId>alfresco-solr-distribution</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
|
||||||
<name>Alfresco Solr Distribution</name>
|
<name>Alfresco Solr Distribution</name>
|
||||||
<description>Produces the solr distribution zip</description>
|
<description>Produces the solr distribution zip</description>
|
||||||
<properties>
|
<properties>
|
||||||
@@ -12,7 +11,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.alfresco</groupId>
|
<groupId>org.alfresco</groupId>
|
||||||
<artifactId>alfresco-solr-parent</artifactId>
|
<artifactId>alfresco-solr-parent</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>6.0-SNAPSHOT</version>
|
||||||
<relativePath>../pom.xml</relativePath>
|
<relativePath>../pom.xml</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@@ -35,13 +35,5 @@
|
|||||||
<exclude>context.xml</exclude>
|
<exclude>context.xml</exclude>
|
||||||
</excludes>
|
</excludes>
|
||||||
</fileSet>
|
</fileSet>
|
||||||
<!-- Just create an empty data directory -->
|
|
||||||
<fileSet>
|
|
||||||
<directory>src/assembly</directory>
|
|
||||||
<outputDirectory>data</outputDirectory>
|
|
||||||
<excludes>
|
|
||||||
<exclude>*</exclude>
|
|
||||||
</excludes>
|
|
||||||
</fileSet>
|
|
||||||
</fileSets>
|
</fileSets>
|
||||||
</assembly>
|
</assembly>
|
||||||
|
4
packaging/src/test/resources/solr.in.sh
Executable file
4
packaging/src/test/resources/solr.in.sh
Executable file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Path to a directory for Solr to store cores and their data. By default, Solr will use server/solr
|
||||||
|
# This directory needs to contain solr.xml
|
||||||
|
SOLR_HOME=$DIST_DIR/data/solrhome
|
2
pom.xml
2
pom.xml
@@ -7,7 +7,7 @@
|
|||||||
<version>7</version>
|
<version>7</version>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>alfresco-solr-parent</artifactId>
|
<artifactId>alfresco-solr-parent</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>6.0-SNAPSHOT</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<name>Alfresco Solr parent</name>
|
<name>Alfresco Solr parent</name>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user