Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor3 #1121

Merged
merged 42 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
53f2600
Add Spring boot support
Mar 29, 2021
ecf327c
Merging Code in Springboot
Jul 14, 2021
6c02bb7
Correction of some tests
Jul 14, 2021
27ac2f3
Delete /SecurityUtilsTest.java
Janite Jul 14, 2021
b9eeca4
add enableEtl flag in application.yml
Janite Jul 14, 2021
1aca9c5
fix: renamed the module with correct name in build file
mayankgituni Jul 14, 2021
b0a340b
null pointer issue fix
justinapromore Jul 14, 2021
d1e915c
Minor chnages in integration test
Jul 15, 2021
32c3bbf
Fix pd
Jul 16, 2021
033725c
Minor fix
Jul 16, 2021
ab372b7
Added Keycloak support
Jul 20, 2021
d493697
Added login controller
Jul 20, 2021
8a12001
AP-2529 Refactor CSV Exporter to reduce memory footprint (#1107)
franklma Jul 20, 2021
3cef495
Minor bug fix
Jul 20, 2021
c79edc7
Merge branch 'refactor3' of github.com:apromore/ApromoreCore into ref…
Jul 20, 2021
8173ca0
Minor path change in js
Jul 20, 2021
c81d877
minor chnages to log dir in application
Jul 20, 2021
16410c0
fix: the css and impala error
mayanktomar20 Jul 21, 2021
2e8a2f7
fix: session issues
mayanktomar20 Jul 21, 2021
6d9f6eb
Minor fix in css and security
Jul 22, 2021
d158cca
Merge branch 'refactor3' of github.com:apromore/ApromoreCore into ref…
Jul 22, 2021
cdda924
Appl yaml
Jul 22, 2021
3ba1b6c
Changes in spring security
Jul 22, 2021
162980c
fix: links in UserAdminController and username error message for crea…
Janite Jul 23, 2021
d994fdd
Merge pull request #1113 from apromore/bugfix/AP-4245/Fix-create-user…
nolantellis Jul 23, 2021
7ab6bb5
AP-4284 Save BPMN Model on Process Discoverer is returning error (#1111)
franklma Jul 23, 2021
c7e58ca
Bugfix/AP-4292/select all select none labels switched (#1114)
Janite Jul 23, 2021
81b1cf2
Change properties
Jul 23, 2021
6ccf8a8
Merge branch 'refactor3' of github.com:apromore/ApromoreCore into ref…
Jul 23, 2021
6f4d3f9
Added docker-compose
Jul 23, 2021
bb29354
AP-3702 ordering of bpmn file
justinapromore Jul 23, 2021
c0dd222
fix etl menu item order and add a seperator before etl in menu
Janite Jul 26, 2021
7b4459a
Merge pull request #1117 from apromore/AP-4320/fix-etl-menu-item-order
nolantellis Jul 26, 2021
3199180
Added global handling
Jul 26, 2021
2a7c2bf
Merge branch 'refactor3' of github.com:apromore/ApromoreCore into ref…
Jul 26, 2021
9583d49
AP-4247 Hide buttons in PD according to user's access type to Log
Jul 26, 2021
cbd46f6
Merge dash changes from dev branch
Jul 26, 2021
7a9ddd8
Merge branch 'AP-4247-springboot' into refactor3
Jul 27, 2021
a8b423a
Comment secure flag for http
Jul 27, 2021
b4565a8
Merge branch 'refactor3' of github.com:apromore/ApromoreCore into ref…
Jul 27, 2021
caed31a
Fix minnnor bugs
Jul 27, 2021
dfe1bed
Merge development branch
Jul 27, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Minor bug fix
  • Loading branch information
Nolan Tellis committed Jul 20, 2021
commit 3cef495aa5b0cd1460cc21b98f2ad0e7e317f7dd
2 changes: 1 addition & 1 deletion Apromore-Boot/src/main/resources/i18n.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
i18n.enable = false
i18n.enable = true
i18n.languagetags = en|ja
i18n.datetimepatterns = dd MMM yy, HH:mm|yyyy年MM月dd日, HH:mm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

package org.apromore.commons.config;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.context.properties.ConfigurationProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
Expand All @@ -34,7 +33,6 @@
@NoArgsConstructor
@AllArgsConstructor
@ConfigurationProperties
@Qualifier("configBean")
public class ConfigBean {
private String logsDir = "../Event-Logs-Repository";
private String numOfEvent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.List;
import org.apromore.apmlog.APMLog;
import org.apromore.calendar.model.CalendarModel;
import org.apromore.commons.config.ConfigBean;
import org.apromore.dao.model.Log;
import org.apromore.dao.model.User;
import org.apromore.exception.ImportException;
Expand Down Expand Up @@ -148,5 +149,7 @@ void cloneLog(String username, Integer folderId, String logName, Integer sourcel
* @throws ObjectCreationException
*/
boolean saveFileToVolume(String filename, String volumePath, String prefix,
ByteArrayOutputStream baos) throws IOException, ObjectCreationException;
ByteArrayOutputStream baos) throws IOException, ObjectCreationException;

ConfigBean getConfigBean();
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import lombok.Getter;


/**
Expand All @@ -116,7 +117,9 @@ public class EventLogServiceImpl implements EventLogService {
private UsermetadataRepository usermetadataRepo;
private TemporaryCacheService tempCacheService;
private StorageManagementFactory<StorageClient> storageFactory;
private ConfigBean config;

@Getter
private ConfigBean configBean;
private EventLogFileService logFileService;
private StorageRepository storageRepository;
private CustomCalendarRepository customCalendarRepository;
Expand Down Expand Up @@ -156,7 +159,7 @@ public EventLogServiceImpl(final LogRepository logRepository,
this.usermetadataRepo = usermetadataRepository;
this.tempCacheService = temporaryCacheService;
this.storageFactory = storageFactory;
this.config = configBean;
this.configBean = configBean;
this.logFileService = logFileService;
this.storageRepository = storageRepository;
this.customCalendarRepository = customCalendarRepository;
Expand Down Expand Up @@ -388,14 +391,14 @@ private void updateLogName(Log log, String newName) throws Exception {
String file_name = log.getFilePath() + "_" + log.getName() + ".xes.gz";
String new_file_name = log.getFilePath() + "_" + newName + ".xes.gz";
Storage storage = new Storage();
storage.setStoragePath(config.getStoragePath());
storage.setStoragePath(configBean.getStoragePath());
storage.setKey(new_file_name);
storage.setPrefix("log");
log.setStorage(storageRepository.saveAndFlush(storage));

StorageClient currentStorage = storageFactory
.getStorageClient("FILE" + StorageType.STORAGE_PATH_SEPARATOR + config.getLogsDir());
StorageClient newStorage = storageFactory.getStorageClient(config.getStoragePath());
.getStorageClient("FILE" + StorageType.STORAGE_PATH_SEPARATOR + configBean.getLogsDir());
StorageClient newStorage = storageFactory.getStorageClient(configBean.getStoragePath());

OutputStream outputStream;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ private void populateMenubar(Menubar menubar) {
if (plugin.getResourceAsStream(plugin.getIconPath()) != null) {
try {
menuitem.setClientDataAttribute("itemCode", itemCode);
menuitem.setImage("portalPluginResource/" + URLEncoder.encode(group, "utf-8") + "/"
menuitem.setImage("/portalPluginResource/" + URLEncoder.encode(group, "utf-8") + "/"
+ URLEncoder.encode(itemCode, "utf-8") + "/" + plugin.getIconPath());

} catch (UnsupportedEncodingException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public Availability getAvailability() {
public ResourceBundle getLabels() {
// Locale locale = Locales.getCurrent()
Locale locale = (Locale) Sessions.getCurrent().getAttribute(Attributes.PREFERRED_LOCALE);
return ResourceBundle.getBundle("metainfo.zk-label", locale,
return ResourceBundle.getBundle("access-control", locale,
AccessControlPlugin.class.getClassLoader());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ private void checkShowRelatedArtifacts() {
public ResourceBundle getLabels() {
// Locale locale = Locales.getCurrent()
Locale locale = (Locale) Sessions.getCurrent().getAttribute(Attributes.PREFERRED_LOCALE);
return ResourceBundle.getBundle("metainfo.zk-label", locale,
return ResourceBundle.getBundle("access-control", locale,
AccessController.class.getClassLoader());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
Apromore.CONFIG = {};
}
//Apromore.CONFIG.SERVER_HANDLER_ROOT_PREFIX = '../../' + '${arg.editor}';
Apromore.CONFIG.SERVER_HANDLER_ROOT_PREFIX = '/' + '${arg.editor}';
Apromore.CONFIG.SERVER_HANDLER_ROOT_PREFIX = '~./' + '${arg.editor}';
]]>
</n:script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@

package org.apromore.plugin.portal.processdiscoverer.plugins;

import java.util.*;

import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
import java.util.UUID;
import org.apromore.logman.attribute.graph.MeasureType;
import org.apromore.plugin.portal.DefaultPortalPlugin;
import org.apromore.plugin.portal.PortalContext;
Expand All @@ -44,111 +48,114 @@

public class PDAbstractPlugin extends DefaultPortalPlugin {

private String label = "Discover process map / BPMN model";
private String groupLabel = "Discover";
protected String sessionId = "";

@Override
public String getLabel(Locale locale) {
return label;
}
private String label = "Discover process map / BPMN model";
private String groupLabel = "Discover";
protected String sessionId = "";

public void setLabel(String label) {
this.label = label;
}
@Override
public String getLabel(Locale locale) {
return label;
}

@Override
public String getGroupLabel(Locale locale) {
return groupLabel;
}
public void setLabel(String label) {
this.label = label;
}

public void setGroupLabel(String groupLabel) {
this.groupLabel = groupLabel;
}

@Override
public void execute(PortalContext context) {

}
@Override
public String getGroupLabel(Locale locale) {
return groupLabel;
}

public ResourceBundle getLabels() {
return ResourceBundle.getBundle("metainfo.zk-label",
(Locale) Sessions.getCurrent().getAttribute(Attributes.PREFERRED_LOCALE),
PDController.class.getClassLoader());
}
public void setGroupLabel(String groupLabel) {
this.groupLabel = groupLabel;
}

public String getLabel(String key) {
String label = getLabels().getString(key);
if (label == null) {
label = "";
}
return label;
}
@Override
public void execute(PortalContext context) {

protected boolean prepare(PortalContext context, MeasureType visType) {
try {
Map<SummaryType, List<VersionSummaryType>> elements = context.getSelection().getSelectedProcessModelVersions();
if (elements.size() != 1) {
Messagebox.show(getLabel("selectOneLog_message"), "Apromore", Messagebox.OK, Messagebox.INFORMATION);
return false;
}
SummaryType selection = elements.keySet().iterator().next();
if (!(selection instanceof LogSummaryType)) {
Messagebox.show(getLabel("selectALog_message"), "Apromore", Messagebox.OK, Messagebox.INFORMATION);
return false;
}

String username = context.getCurrentUser().getUsername();
ProcessSummaryType process = new ProcessSummaryType();
process.setDomain("Process Discoverer");
process.setName("Process Discoverer");
process.setId(1);
process.setMakePublic(true);
VersionSummaryType version = new VersionSummaryType();
version.setName("Process Discoverer");
version.setVersionNumber("1.0");

EditSessionType editSession1 = createEditSession(username, process, version);
ApromoreSession session = new ApromoreSession(editSession1, null,
(MainController)context.getMainController(),
process, version, null, null,
new HashSet<RequestParameterType<?>>());
session.put("context", context);
session.put("visType", visType);
session.put("selection", selection);
session.put("pdFactory", new PDCustomFactory());

sessionId = UUID.randomUUID().toString();
UserSessionManager.setEditSession(sessionId, session);

} catch (Exception e) {
e.printStackTrace();
}

return true;
}

public ResourceBundle getLabels() {
return ResourceBundle.getBundle("pd",
(Locale) Sessions.getCurrent().getAttribute(Attributes.PREFERRED_LOCALE),
PDController.class.getClassLoader());
}

public String getLabel(String key) {
String label = getLabels().getString(key);
if (label == null) {
label = "";
}

public String getSessionId() {
return sessionId;
}

private static EditSessionType createEditSession(final String username, final ProcessSummaryType process, final VersionSummaryType version) {
EditSessionType editSession = new EditSessionType();
editSession.setDomain(process.getDomain());
editSession.setNativeType("BPMN 2.0");
editSession.setProcessId(process.getId());
editSession.setProcessName(process.getName());
editSession.setUsername(username);
editSession.setPublicModel(process.isMakePublic());
editSession.setOriginalBranchName(version.getName());
editSession.setOriginalVersionNumber(version.getVersionNumber());
editSession.setCurrentVersionNumber(version.getVersionNumber());
editSession.setMaxVersionNumber(process.getLastVersion());
editSession.setCreationDate(version.getCreationDate());
editSession.setLastUpdate(version.getLastUpdate());
editSession.setWithAnnotation(false);

return editSession;
return label;
}

protected boolean prepare(PortalContext context, MeasureType visType) {
try {
Map<SummaryType, List<VersionSummaryType>> elements =
context.getSelection().getSelectedProcessModelVersions();
if (elements.size() != 1) {
Messagebox.show(getLabel("selectOneLog_message"), "Apromore", Messagebox.OK,
Messagebox.INFORMATION);
return false;
}
SummaryType selection = elements.keySet().iterator().next();
if (!(selection instanceof LogSummaryType)) {
Messagebox.show(getLabel("selectALog_message"), "Apromore", Messagebox.OK,
Messagebox.INFORMATION);
return false;
}

String username = context.getCurrentUser().getUsername();
ProcessSummaryType process = new ProcessSummaryType();
process.setDomain("Process Discoverer");
process.setName("Process Discoverer");
process.setId(1);
process.setMakePublic(true);
VersionSummaryType version = new VersionSummaryType();
version.setName("Process Discoverer");
version.setVersionNumber("1.0");

EditSessionType editSession1 = createEditSession(username, process, version);
ApromoreSession session =
new ApromoreSession(editSession1, null, (MainController) context.getMainController(),
process, version, null, null, new HashSet<RequestParameterType<?>>());
session.put("context", context);
session.put("visType", visType);
session.put("selection", selection);
session.put("pdFactory", new PDCustomFactory());

sessionId = UUID.randomUUID().toString();
UserSessionManager.setEditSession(sessionId, session);

} catch (Exception e) {
e.printStackTrace();
}

return true;

}

public String getSessionId() {
return sessionId;
}

private static EditSessionType createEditSession(final String username,
final ProcessSummaryType process, final VersionSummaryType version) {
EditSessionType editSession = new EditSessionType();
editSession.setDomain(process.getDomain());
editSession.setNativeType("BPMN 2.0");
editSession.setProcessId(process.getId());
editSession.setProcessName(process.getName());
editSession.setUsername(username);
editSession.setPublicModel(process.isMakePublic());
editSession.setOriginalBranchName(version.getName());
editSession.setOriginalVersionNumber(version.getVersionNumber());
editSession.setCurrentVersionNumber(version.getVersionNumber());
editSession.setMaxVersionNumber(process.getLastVersion());
editSession.setCreationDate(version.getCreationDate());
editSession.setLastUpdate(version.getLastUpdate());
editSession.setWithAnnotation(false);

return editSession;
}
}
Loading