Skip to content

Commit 675fb31

Browse files
committed
updating gradle dependencies
updating ui component names adding mime type for fonts speed up stuff by removing performance logging
1 parent 9462988 commit 675fb31

File tree

86 files changed

+181
-812
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+181
-812
lines changed

marklogic-data-hub/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
id 'java'
44
id 'maven-publish'
55
id 'com.jfrog.bintray' version '1.7.2'
6-
id 'com.marklogic.ml-gradle' version '2.5.0'
6+
id 'com.marklogic.ml-gradle' version '2.6.0'
77
id 'com.moowork.node' version '1.1.1'
88
}
99

@@ -20,8 +20,8 @@ targetCompatibility = 1.8
2020

2121
dependencies {
2222
compile 'com.marklogic:marklogic-client-api:4.0-SNAPSHOT'
23-
compile 'com.marklogic:ml-javaclient-util:2.12.1'
24-
compile 'com.marklogic:ml-app-deployer:2.5.0'
23+
compile 'com.marklogic:ml-javaclient-util:2.13.0'
24+
compile 'com.marklogic:ml-app-deployer:2.6.0'
2525
compile 'commons-io:commons-io:2.4'
2626
testCompile 'junit:junit:4.12'
2727
testCompile 'xmlunit:xmlunit:1.3'

marklogic-data-hub/src/main/java/com/marklogic/hub/DataHub.java

Lines changed: 28 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,9 @@
1919
import com.fasterxml.jackson.databind.ObjectMapper;
2020
import com.marklogic.appdeployer.AppConfig;
2121
import com.marklogic.appdeployer.command.Command;
22-
import com.marklogic.appdeployer.command.alert.DeployAlertActionsCommand;
23-
import com.marklogic.appdeployer.command.alert.DeployAlertConfigsCommand;
24-
import com.marklogic.appdeployer.command.alert.DeployAlertRulesCommand;
22+
import com.marklogic.appdeployer.command.CommandMapBuilder;
2523
import com.marklogic.appdeployer.command.appservers.DeployOtherServersCommand;
26-
import com.marklogic.appdeployer.command.cpf.DeployCpfConfigsCommand;
27-
import com.marklogic.appdeployer.command.cpf.DeployDomainsCommand;
28-
import com.marklogic.appdeployer.command.cpf.DeployPipelinesCommand;
29-
import com.marklogic.appdeployer.command.flexrep.DeployConfigsCommand;
30-
import com.marklogic.appdeployer.command.flexrep.DeployFlexrepCommand;
31-
import com.marklogic.appdeployer.command.flexrep.DeployTargetsCommand;
32-
import com.marklogic.appdeployer.command.forests.ConfigureForestReplicasCommand;
33-
import com.marklogic.appdeployer.command.groups.DeployGroupsCommand;
3424
import com.marklogic.appdeployer.command.mimetypes.DeployMimetypesCommand;
35-
import com.marklogic.appdeployer.command.schemas.LoadSchemasCommand;
36-
import com.marklogic.appdeployer.command.security.*;
37-
import com.marklogic.appdeployer.command.tasks.DeployScheduledTasksCommand;
38-
import com.marklogic.appdeployer.command.triggers.DeployTriggersCommand;
39-
import com.marklogic.appdeployer.command.viewschemas.DeployViewSchemasCommand;
4025
import com.marklogic.appdeployer.impl.SimpleAppDeployer;
4126
import com.marklogic.client.DatabaseClient;
4227
import com.marklogic.client.FailedRequestException;
@@ -74,6 +59,7 @@
7459
import java.nio.file.attribute.BasicFileAttributes;
7560
import java.util.ArrayList;
7661
import java.util.List;
62+
import java.util.Map;
7763
import java.util.regex.Pattern;
7864

7965
public class DataHub {
@@ -309,107 +295,43 @@ public JsonNode validateUserModules() {
309295
return ev.validate();
310296
}
311297

312-
public List<Command> getCommands() {
298+
public List<Command> getCommandList() {
299+
Map<String, List<Command>> commandMap = getCommands();
313300
List<Command> commands = new ArrayList<>();
301+
for (String name : commandMap.keySet()) {
302+
commands.addAll(commandMap.get(name));
303+
}
304+
return commands;
305+
}
306+
public Map<String, List<Command>> getCommands() {
307+
Map<String, List<Command>> commandMap = new CommandMapBuilder().buildCommandMap();
314308

315-
// Security
316-
List<Command> securityCommands = new ArrayList<>();
317-
securityCommands.add(new DeployRolesCommand());
318-
securityCommands.add(new DeployUsersCommand());
319-
securityCommands.add(new DeployAmpsCommand());
320-
securityCommands.add(new DeployCertificateTemplatesCommand());
321-
securityCommands.add(new DeployCertificateAuthoritiesCommand());
322-
securityCommands.add(new DeployExternalSecurityCommand());
323-
securityCommands.add(new DeployPrivilegesCommand());
324-
securityCommands.add(new DeployProtectedCollectionsCommand());
325-
commands.addAll(securityCommands);
326-
327-
// Databases
328309
List<Command> dbCommands = new ArrayList<>();
329-
330-
// deploy hub databases (staging, final, job, trace)
331310
dbCommands.add(new DeployHubDatabasesCommand(hubConfig));
332-
333-
// deploy user databases in user-config dir
334311
dbCommands.add(new DeployHubOtherDatabasesCommand(hubConfig));
335-
336-
// depoloy triggers database
337312
dbCommands.add(new DeployHubTriggersDatabaseCommand(hubConfig));
338-
339-
// depoloy schemas database
340313
dbCommands.add(new DeployHubSchemasDatabaseCommand(hubConfig));
341-
commands.addAll(dbCommands);
342-
343-
// Schemas
344-
LoadSchemasCommand lsc = new LoadSchemasCommand();
345-
commands.add(lsc);
314+
commandMap.put("mlDatabaseCommands", dbCommands);
346315

347-
// App servers
348-
// deploy hub app servers (staging, final, job, trace)
349-
commands.add(new DeployHubServersCommand(hubConfig));
316+
// don't deploy rest api servers
317+
commandMap.remove("mlRestApiCommands");
350318

351-
// deploy user app servers in user-config
319+
List<Command> serverCommands = new ArrayList<>();
320+
serverCommands.add(new DeployHubServersCommand(hubConfig));
352321
DeployOtherServersCommand otherServersCommand = new DeployOtherServersCommand();
353322
otherServersCommand.setFilenamesToIgnore("staging-server.json", "final-server.json", "job-server.json", "trace-server.json");
354-
commands.add(otherServersCommand);
323+
serverCommands.add(otherServersCommand);
324+
commandMap.put("mlServerCommands", serverCommands);
355325

356-
// Modules
357-
commands.add(new LoadHubModulesCommand(hubConfig));
358-
commands.add(new LoadUserModulesCommand(hubConfig));
359-
360-
// Alerting
361-
List<Command> alertCommands = new ArrayList<>();
362-
alertCommands.add(new DeployAlertConfigsCommand());
363-
alertCommands.add(new DeployAlertActionsCommand());
364-
alertCommands.add(new DeployAlertRulesCommand());
365-
commands.addAll(alertCommands);
366-
367-
// CPF
368-
List<Command> cpfCommands = new ArrayList<>();
369-
cpfCommands.add(new DeployCpfConfigsCommand());
370-
cpfCommands.add(new DeployDomainsCommand());
371-
cpfCommands.add(new DeployPipelinesCommand());
372-
commands.addAll(cpfCommands);
373-
374-
// Flexrep
375-
List<Command> flexrepCommands = new ArrayList<>();
376-
flexrepCommands.add(new DeployConfigsCommand());
377-
flexrepCommands.add(new DeployTargetsCommand());
378-
flexrepCommands.add(new DeployFlexrepCommand());
379-
commands.addAll(flexrepCommands);
380-
381-
// Groups
382-
List<Command> groupCommands = new ArrayList<>();
383-
groupCommands.add(new DeployGroupsCommand());
384-
commands.addAll(groupCommands);
385-
386-
List<Command> mimetypeCommands = new ArrayList<>();
387-
mimetypeCommands.add(new DeployMimetypesCommand());
388-
commands.addAll(mimetypeCommands);
389-
390-
// Forest replicas
391-
List<Command> replicaCommands = new ArrayList<>();
392-
replicaCommands.add(new ConfigureForestReplicasCommand());
393-
commands.addAll(replicaCommands);
394-
395-
// Tasks
396-
List<Command> taskCommands = new ArrayList<>();
397-
taskCommands.add(new DeployScheduledTasksCommand());
398-
commands.addAll(taskCommands);
399-
400-
// Triggers
401-
List<Command> triggerCommands = new ArrayList<>();
402-
triggerCommands.add(new DeployTriggersCommand());
403-
commands.addAll(triggerCommands);
404-
405-
// SQL Views
406-
List<Command> viewCommands = new ArrayList<>();
407-
DeployViewSchemasCommand deployViewSchemasCommand = new DeployViewSchemasCommand();
408-
deployViewSchemasCommand.setDatabaseIdOrName(hubConfig.finalDbName);
409-
viewCommands.add(deployViewSchemasCommand);
410-
commands.addAll(viewCommands);
326+
List<Command> moduleCommands = new ArrayList<>();
327+
moduleCommands.add(new LoadHubModulesCommand(hubConfig));
328+
moduleCommands.add(new LoadUserModulesCommand(hubConfig));
329+
commandMap.put("mlModuleCommands", moduleCommands);
411330

412-
return commands;
331+
List<Command> mimetypeCommands = commandMap.get("mlMimetypeCommands");
332+
mimetypeCommands.add(0, new DeployHubMimetypesCommand(hubConfig));
333+
334+
return commandMap;
413335
}
414336

415337
/**
@@ -430,7 +352,7 @@ public void install(HubDeployStatusListener listener) {
430352

431353
AppConfig config = hubConfig.getAppConfig();
432354
HubAppDeployer deployer = new HubAppDeployer(getManageClient(), getAdminManager(), listener);
433-
deployer.setCommands(getCommands());
355+
deployer.setCommands(getCommandList());
434356
deployer.deploy(config);
435357
}
436358

@@ -459,7 +381,7 @@ public void uninstall(HubDeployStatusListener listener) {
459381

460382
AppConfig config = hubConfig.getAppConfig();
461383
HubAppDeployer deployer = new HubAppDeployer(getManageClient(), getAdminManager(), listener);
462-
deployer.setCommands(getCommands());
384+
deployer.setCommands(getCommandList());
463385
deployer.undeploy(config);
464386
}
465387

marklogic-data-hub/src/main/java/com/marklogic/hub/HubConfig.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,10 @@ public Path getUserServersDir() {
360360
return Paths.get(this.projectDir, USER_CONFIG_DIR, "servers");
361361
}
362362

363+
public Path getHubMimetypesDir() {
364+
return Paths.get(this.projectDir, HUB_CONFIG_DIR, "mimetypes");
365+
}
366+
363367
public void setUsername(String username) {
364368
this.username = username;
365369
}

marklogic-data-hub/src/main/java/com/marklogic/hub/HubProject.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ public void init() {
100100
writeResourceFileWithReplace("ml-config/security/roles/data-hub-user.json", rolesDir.resolve("data-hub-user.json"), true);
101101
writeResourceFileWithReplace("ml-config/security/users/data-hub-user.json", usersDir.resolve("data-hub-user.json"), true);
102102

103+
Path mimetypesDir = hubConfig.getHubMimetypesDir();
104+
mimetypesDir.toFile().mkdirs();
105+
writeResourceFile("ml-config/mimetypes/woff.json", mimetypesDir.resolve("woff.json"), true);
106+
writeResourceFile("ml-config/mimetypes/woff2.json", mimetypesDir.resolve("woff2.json"), true);
107+
103108
hubConfig.getUserServersDir().toFile().mkdirs();
104109
hubConfig.getUserDatabaseDir().toFile().mkdirs();
105110

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.marklogic.hub.deploy.commands;
2+
3+
import com.marklogic.appdeployer.command.CommandContext;
4+
import com.marklogic.appdeployer.command.mimetypes.DeployMimetypesCommand;
5+
import com.marklogic.hub.HubConfig;
6+
7+
import java.io.File;
8+
9+
public class DeployHubMimetypesCommand extends DeployMimetypesCommand {
10+
11+
private HubConfig config;
12+
13+
public DeployHubMimetypesCommand(HubConfig config) {
14+
super();
15+
this.config = config;
16+
}
17+
18+
@Override
19+
protected File[] getResourceDirs(CommandContext context) {
20+
return new File[]{config.getHubMimetypesDir().toFile()};
21+
}
22+
}

marklogic-data-hub/src/main/java/com/marklogic/hub/deploy/commands/LoadHubModulesCommand.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,19 @@ private Content prepContent(String uri, InputStream inputStream, AppConfig confi
7676
logger.info(format("Inserting module with URI: %s", uri));
7777
}
7878

79-
String fileContents = IOUtils.toString(inputStream);
80-
Map<String, String> customTokens = config.getCustomTokens();
81-
if (customTokens != null) {
82-
for (String key : customTokens.keySet()) {
83-
fileContents = fileContents.replace(key, customTokens.get(key));
79+
if (uri.endsWith(".xqy")) {
80+
String fileContents = IOUtils.toString(inputStream);
81+
Map<String, String> customTokens = config.getCustomTokens();
82+
if (customTokens != null) {
83+
for (String key : customTokens.keySet()) {
84+
fileContents = fileContents.replace(key, customTokens.get(key));
85+
}
8486
}
87+
88+
return ContentFactory.newContent(uri, fileContents, options);
8589
}
8690

87-
return ContentFactory.newContent(uri, fileContents, options);
91+
return ContentFactory.newContent(uri, inputStream, options);
8892
}
8993

9094
private void initializeActiveSession(CommandContext context) {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "application/font-woff",
3+
"extension": [
4+
"woff"
5+
],
6+
"format": "binary"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "application/font-woff2",
3+
"extension": [
4+
"woff2"
5+
],
6+
"format": "binary"
7+
}

marklogic-data-hub/src/trace-ui/.angular-cli.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
33
"project": {
4-
"version": "1.0.0-beta.32.3",
54
"name": "trace-ui"
65
},
76
"apps": [
@@ -40,10 +39,10 @@
4039
},
4140
"lint": [
4241
{
43-
"project": "src/main/ui/tsconfig.app.json"
42+
"project": "src/tsconfig.app.json"
4443
},
4544
{
46-
"project": "src/main/ui/tsconfig.spec.json"
45+
"project": "src/tsconfig.spec.json"
4746
},
4847
{
4948
"project": "e2e/tsconfig.e2e.json"

marklogic-data-hub/src/trace-ui/src/app/app.module.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import { HttpModule } from '@angular/http';
55
import { RouterModule } from '@angular/router';
66
import { TruncateCharactersPipe } from './truncate'
77

8-
import { ConfirmModule } from './confirm';
9-
108
import { AppComponent } from './app.component';
119

1210
import { MdlModule } from '@angular-mdl/core';
@@ -46,7 +44,6 @@ import { ObjectToArrayPipe } from './object-to-array.pipe';
4644
FormsModule,
4745
HttpModule,
4846
MdlModule,
49-
ConfirmModule,
5047
TooltipModule,
5148
MomentModule,
5249
RouterModule.forRoot(ROUTES, { useHash: true })

0 commit comments

Comments
 (0)