Skip to content

Commit

Permalink
Remove references to webadmin
Browse files Browse the repository at this point in the history
  • Loading branch information
pe4cey committed Mar 10, 2016
1 parent e6b1691 commit 9d7a2d0
Show file tree
Hide file tree
Showing 37 changed files with 480 additions and 759 deletions.
3 changes: 1 addition & 2 deletions RepositoryOverview.asciidoc
Expand Up @@ -110,8 +110,7 @@ neo4j-lucene-index::


neo4j-server:: neo4j-server::
The community version of http://neo4j.com/docs/milestone/reference-documentation.html[the Neo4j server]. The community version of http://neo4j.com/docs/milestone/reference-documentation.html[the Neo4j server].
It contains the functionality of the http://neo4j.com/docs/milestone/rest-api.html[REST API] It contains the functionality of the http://neo4j.com/docs/milestone/rest-api.html[REST API].
and http://neo4j.com/docs/milestone/tools-webadmin.html[the WebAdmin tool].


neo4j-community:: neo4j-community::
The neo4j-community module is a historical alias for the neo4j module. The neo4j-community module is a historical alias for the neo4j module.
Expand Down
3 changes: 0 additions & 3 deletions community/.gitignore
Expand Up @@ -18,9 +18,6 @@ target
cypher/project cypher/project
cypher/lib_managed cypher/lib_managed
cypher/.cache cypher/.cache
server/src/main/resources/webadmin-html/js/neo4j/
server/src/main/resources/webadmin-html/js/ribcage/
server/src/main/resources/webadmin-html/js/webadmin.js
artifacts artifacts
*/bin */bin
*/pom-with-build-number.xml */pom-with-build-number.xml
Expand Down
4 changes: 0 additions & 4 deletions community/server/pom.xml
Expand Up @@ -502,10 +502,6 @@
<title>Server REST Interface</title> <title>Server REST Interface</title>
<packages>org.neo4j.server.rest:org.neo4j.server.rest.*</packages> <packages>org.neo4j.server.rest:org.neo4j.server.rest.*</packages>
</group> </group>
<group>
<title>Server Admin Interface</title>
<packages>org.neo4j.server.webadmin:org.neo4j.server.webadmin.*</packages>
</group>
</groups> </groups>
</configuration> </configuration>
</plugin> </plugin>
Expand Down
Expand Up @@ -19,10 +19,6 @@
*/ */
package org.neo4j.server; package org.neo4j.server;


import com.sun.jersey.api.core.HttpContext;
import org.apache.commons.configuration.Configuration;
import org.bouncycastle.operator.OperatorCreationException;

import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.net.URI; import java.net.URI;
Expand All @@ -36,6 +32,10 @@
import java.util.regex.Pattern; import java.util.regex.Pattern;
import javax.servlet.Filter; import javax.servlet.Filter;


import com.sun.jersey.api.core.HttpContext;
import org.apache.commons.configuration.Configuration;
import org.bouncycastle.operator.OperatorCreationException;

import org.neo4j.bolt.security.ssl.Certificates; import org.neo4j.bolt.security.ssl.Certificates;
import org.neo4j.bolt.security.ssl.KeyStoreFactory; import org.neo4j.bolt.security.ssl.KeyStoreFactory;
import org.neo4j.bolt.security.ssl.KeyStoreInformation; import org.neo4j.bolt.security.ssl.KeyStoreInformation;
Expand Down Expand Up @@ -85,6 +85,7 @@
import static java.lang.Math.round; import static java.lang.Math.round;
import static java.lang.String.format; import static java.lang.String.format;
import static java.util.concurrent.TimeUnit.MILLISECONDS; import static java.util.concurrent.TimeUnit.MILLISECONDS;

import static org.neo4j.helpers.Clock.SYSTEM_CLOCK; import static org.neo4j.helpers.Clock.SYSTEM_CLOCK;
import static org.neo4j.helpers.collection.Iterables.map; import static org.neo4j.helpers.collection.Iterables.map;
import static org.neo4j.kernel.impl.util.JobScheduler.Groups.serverTransactionTimeout; import static org.neo4j.kernel.impl.util.JobScheduler.Groups.serverTransactionTimeout;
Expand All @@ -105,7 +106,6 @@ public abstract class AbstractNeoServer implements NeoServer


private static final Pattern[] DEFAULT_URI_WHITELIST = new Pattern[]{ private static final Pattern[] DEFAULT_URI_WHITELIST = new Pattern[]{
Pattern.compile( "/browser.*" ), Pattern.compile( "/browser.*" ),
Pattern.compile( "/webadmin.*" ),
Pattern.compile( "/" ) Pattern.compile( "/" )
}; };


Expand Down
Expand Up @@ -53,10 +53,10 @@ public DiscoveryService( @Context Config configuration, @Context OutputFormat ou
@Produces( MediaType.APPLICATION_JSON ) @Produces( MediaType.APPLICATION_JSON )
public Response getDiscoveryDocument() throws URISyntaxException public Response getDiscoveryDocument() throws URISyntaxException
{ {
String webAdminManagementUri = configuration.get( ServerSettings.management_api_path ).getPath() + "/"; String managementUri = configuration.get( ServerSettings.management_api_path ).getPath() + "/";
String dataUri = configuration.get( ServerSettings.rest_api_path ).getPath() + "/"; String dataUri = configuration.get( ServerSettings.rest_api_path ).getPath() + "/";


return outputFormat.ok( new DiscoveryRepresentation( webAdminManagementUri, dataUri ) ); return outputFormat.ok( new DiscoveryRepresentation( managementUri, dataUri ) );
} }


@GET @GET
Expand Down
Expand Up @@ -28,7 +28,6 @@
public class HtmlHelper public class HtmlHelper
{ {
private final static String STYLE_LOCATION = "http://resthtml.neo4j.org/style/"; private final static String STYLE_LOCATION = "http://resthtml.neo4j.org/style/";
private final static String HTML_JAVASCRIPT_LOCATION = "/webadmin/htmlbrowse.js";


public static String from( final Object object, final ObjectType objectType ) public static String from( final Object object, final ObjectType objectType )
{ {
Expand All @@ -53,7 +52,6 @@ public static StringBuilder start( final String title, final String additionalCo
} }
builder.append( "<meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\">\n" + "<link href='" builder.append( "<meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\">\n" + "<link href='"
+ STYLE_LOCATION + "rest.css' rel='stylesheet' type='text/css'>\n" + STYLE_LOCATION + "rest.css' rel='stylesheet' type='text/css'>\n"
+ "<script type='text/javascript' src='" + HTML_JAVASCRIPT_LOCATION + "'></script>\n"
+ "</head>\n<body onload='javascript:neo4jHtmlBrowse.start();' id='" + title.toLowerCase() + "</head>\n<body onload='javascript:neo4jHtmlBrowse.start();' id='" + title.toLowerCase()
+ "'>\n" + "<div id='content'>" + "<div id='header'>" + "'>\n" + "<div id='content'>" + "<div id='header'>"
+ "<h1><a title='Neo4j REST interface' href='/'><span>Neo4j REST interface</span></a></h1>" + "<h1><a title='Neo4j REST interface' href='/'><span>Neo4j REST interface</span></a></h1>"
Expand Down
Expand Up @@ -68,22 +68,22 @@ public void shouldPickUpPortFromConfig() throws Exception
} }


@Test @Test
public void shouldPickupRelativeUrisForWebAdminAndWebAdminRest() throws IOException public void shouldPickupRelativeUrisForMangementApiAndRestApi() throws IOException
{ {
String webAdminDataUri = "/a/different/data/uri/"; String dataUri = "/a/different/data/uri/";
String webAdminManagementUri = "/a/different/management/uri/"; String managementUri = "/a/different/management/uri/";


server = server().withRelativeWebDataAdminUriPath( webAdminDataUri ) server = server().withRelativeRestApiUriPath( dataUri )
.usingDataDir( folder.directory( name.getMethodName() ).getAbsolutePath() ) .usingDataDir( folder.directory( name.getMethodName() ).getAbsolutePath() )
.withRelativeWebAdminUriPath( webAdminManagementUri ) .withRelativeManagementApiUriPath( managementUri )
.build(); .build();
server.start(); server.start();


JaxRsResponse response = new RestRequest().get( "http://localhost:7474" + webAdminDataUri, JaxRsResponse response = new RestRequest().get( "http://localhost:7474" + dataUri,
MediaType.TEXT_HTML_TYPE ); MediaType.TEXT_HTML_TYPE );
assertEquals( 200, response.getStatus() ); assertEquals( 200, response.getStatus() );


response = new RestRequest().get( "http://localhost:7474" + webAdminManagementUri ); response = new RestRequest().get( "http://localhost:7474" + managementUri );
assertEquals( 200, response.getStatus() ); assertEquals( 200, response.getStatus() );
response.close(); response.close();
} }
Expand Down Expand Up @@ -131,7 +131,7 @@ public void shouldNotGenerateWADLWhenExplicitlyDisabledInConfig() throws IOExcep
} }


@Test @Test
public void shouldEnableWebadminConsoleByDefault() throws IOException public void shouldEnablConsoleServiceByDefault() throws IOException
{ {
// Given // Given
server = server().usingDataDir( folder.directory( name.getMethodName() ).getAbsolutePath() ).build(); server = server().usingDataDir( folder.directory( name.getMethodName() ).getAbsolutePath() ).build();
Expand All @@ -142,7 +142,7 @@ public void shouldEnableWebadminConsoleByDefault() throws IOException
} }


@Test @Test
public void shouldDisableWebadminConsoleWhenAskedTo() throws IOException public void shouldDisableConsoleServiceWhenAskedTo() throws IOException
{ {
// Given // Given
server = server().withProperty( ServerSettings.console_module_enabled.name(), "false" ) server = server().withProperty( ServerSettings.console_module_enabled.name(), "false" )
Expand Down
Expand Up @@ -64,8 +64,8 @@ public class CommunityServerBuilder
private String portNo = "7474"; private String portNo = "7474";
private String maxThreads = null; private String maxThreads = null;
protected String dataDir = null; protected String dataDir = null;
private String webAdminUri = "/db/manage/"; private String managementUri = "/db/manage/";
private String webAdminDataUri = "/db/data/"; private String restUri = "/db/data/";
protected PreFlightTasks preflightTasks; protected PreFlightTasks preflightTasks;
private final HashMap<String, String> thirdPartyPackages = new HashMap<>(); private final HashMap<String, String> thirdPartyPackages = new HashMap<>();
private final Properties arbitraryProperties = new Properties(); private final Properties arbitraryProperties = new Properties();
Expand Down Expand Up @@ -134,8 +134,8 @@ public CommunityServerBuilder withClock( Clock clock )
private Map<String, String> createConfiguration( File temporaryFolder ) private Map<String, String> createConfiguration( File temporaryFolder )
{ {
Map<String, String> properties = stringMap( Map<String, String> properties = stringMap(
ServerSettings.management_api_path.name(), webAdminUri, ServerSettings.management_api_path.name(), managementUri,
ServerSettings.rest_api_path.name(), webAdminDataUri ); ServerSettings.rest_api_path.name(), restUri );


ServerTestUtils.addDefaultRelativeProperties( properties, temporaryFolder ); ServerTestUtils.addDefaultRelativeProperties( properties, temporaryFolder );


Expand Down Expand Up @@ -237,18 +237,18 @@ public CommunityServerBuilder usingDataDir( String dataDir )
return this; return this;
} }


public CommunityServerBuilder withRelativeWebAdminUriPath( String webAdminUri ) public CommunityServerBuilder withRelativeManagementApiUriPath( String uri )
{ {
try try
{ {
URI theUri = new URI( webAdminUri ); URI theUri = new URI( uri );
if ( theUri.isAbsolute() ) if ( theUri.isAbsolute() )
{ {
this.webAdminUri = theUri.getPath(); this.managementUri = theUri.getPath();
} }
else else
{ {
this.webAdminUri = theUri.toString(); this.managementUri = theUri.toString();
} }
} }
catch ( URISyntaxException e ) catch ( URISyntaxException e )
Expand All @@ -258,18 +258,18 @@ public CommunityServerBuilder withRelativeWebAdminUriPath( String webAdminUri )
return this; return this;
} }


public CommunityServerBuilder withRelativeWebDataAdminUriPath( String webAdminDataUri ) public CommunityServerBuilder withRelativeRestApiUriPath( String uri )
{ {
try try
{ {
URI theUri = new URI( webAdminDataUri ); URI theUri = new URI( uri );
if ( theUri.isAbsolute() ) if ( theUri.isAbsolute() )
{ {
this.webAdminDataUri = theUri.getPath(); this.restUri = theUri.getPath();
} }
else else
{ {
this.webAdminDataUri = theUri.toString(); this.restUri = theUri.toString();
} }
} }
catch ( URISyntaxException e ) catch ( URISyntaxException e )
Expand Down
Expand Up @@ -17,12 +17,12 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package org.neo4j.server.webadmin.console; package org.neo4j.server.rest;

import org.junit.Test;


import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;


import org.junit.Test;

import org.neo4j.helpers.collection.Pair; import org.neo4j.helpers.collection.Pair;
import org.neo4j.kernel.impl.factory.GraphDatabaseFacade; import org.neo4j.kernel.impl.factory.GraphDatabaseFacade;
import org.neo4j.logging.NullLogProvider; import org.neo4j.logging.NullLogProvider;
Expand Down
Expand Up @@ -20,6 +20,7 @@
package org.neo4j.server.rest; package org.neo4j.server.rest;


import java.net.URI; import java.net.URI;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;


Expand All @@ -29,6 +30,18 @@


import com.sun.jersey.api.client.ClientResponse; import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.core.util.StringKeyObjectValueIgnoreCaseMultivaluedMap; import com.sun.jersey.core.util.StringKeyObjectValueIgnoreCaseMultivaluedMap;
import org.junit.Test;

import org.neo4j.logging.NullLogProvider;
import org.neo4j.server.database.Database;
import org.neo4j.server.rest.management.AdvertisableService;
import org.neo4j.server.rest.management.console.ConsoleService;
import org.neo4j.server.rest.management.repr.ServerRootRepresentation;

import static org.hamcrest.Matchers.containsString;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.mock;


public class JaxRsResponse extends Response public class JaxRsResponse extends Response
{ {
Expand Down Expand Up @@ -120,4 +133,20 @@ public MediaType getType() {
} }




public static class ServerRootRepresentationTest
{
@Test
public void shouldProvideAListOfServiceUris() throws Exception
{
ConsoleService consoleService = new ConsoleService( null, mock( Database.class ), NullLogProvider.getInstance(), null );
ServerRootRepresentation srr = new ServerRootRepresentation( new URI( "http://example.org:9999" ),
Collections.<AdvertisableService>singletonList( consoleService ) );
Map<String, Map<String, String>> map = srr.serialize();

assertNotNull( map.get( "services" ) );

assertThat( map.get( "services" )
.get( consoleService.getName() ), containsString( consoleService.getServerPath() ) );
}
}
} }
Expand Up @@ -19,11 +19,11 @@
*/ */
package org.neo4j.server.rest; package org.neo4j.server.rest;


import java.io.IOException;

import org.junit.BeforeClass; import org.junit.BeforeClass;
import org.junit.Test; import org.junit.Test;


import java.io.IOException;

import org.neo4j.server.helpers.FunctionalTestHelper; import org.neo4j.server.helpers.FunctionalTestHelper;


import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.MatcherAssert.assertThat;
Expand All @@ -41,7 +41,7 @@ public static void setupServer() throws IOException
} }


@Test @Test
public void shouldRespondWithTheWebAdminClientSettings() throws Exception { public void shouldRespondWithJMXResources() throws Exception {
String url = functionalTestHelper.managementUri() + "/server/jmx"; String url = functionalTestHelper.managementUri() + "/server/jmx";
JaxRsResponse resp = RestRequest.req().get(url); JaxRsResponse resp = RestRequest.req().get(url);
String json = resp.getEntity(); String json = resp.getEntity();
Expand Down

0 comments on commit 9d7a2d0

Please sign in to comment.