-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
70 changed files
with
1,450 additions
and
393 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
wfe-core/src/main/java/ru/runa/wfe/datasource/ExcelStorageInitiator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package ru.runa.wfe.datasource; | ||
|
||
import java.io.File; | ||
import lombok.extern.apachecommons.CommonsLog; | ||
import org.dom4j.Document; | ||
import org.dom4j.DocumentHelper; | ||
import org.dom4j.io.OutputFormat; | ||
import ru.runa.wfe.commons.IoCommons; | ||
import ru.runa.wfe.commons.xml.XmlUtils; | ||
|
||
/** | ||
* @author Alekseev Mikhail | ||
* @since #1766 | ||
*/ | ||
@CommonsLog | ||
public class ExcelStorageInitiator { | ||
@SuppressWarnings("ResultOfMethodCallIgnored") | ||
public static synchronized byte[] init() { | ||
if (DataSourceStorage.getNames().contains(DataSourceStuff.INTERNAL_STORAGE_DATA_SOURCE_NAME)) { | ||
return DataSourceStorage.restore(DataSourceStuff.INTERNAL_STORAGE_DATA_SOURCE_NAME); | ||
} | ||
|
||
final String excelStorageDirPath = IoCommons.getExcelStorageDirPath(); | ||
new File(excelStorageDirPath).mkdir(); | ||
log.info("Created " + excelStorageDirPath); | ||
|
||
final Document document = DocumentHelper.createDocument(); | ||
document.addElement(DataSourceStuff.ELEMENT_DATA_SOURCE) | ||
.addAttribute(DataSourceStuff.ATTR_NAME, DataSourceStuff.INTERNAL_STORAGE_DATA_SOURCE_NAME) | ||
.addAttribute(DataSourceStuff.ATTR_TYPE, DataSourceType.Excel.name()) | ||
.addElement(DataSourceStuff.ELEMENT_FILE_PATH).addText(excelStorageDirPath); | ||
final byte[] internalStorageDs = XmlUtils.save(document, OutputFormat.createPrettyPrint()); | ||
DataSourceStorage.save(internalStorageDs, true, false); | ||
log.info(DataSourceStuff.INTERNAL_STORAGE_DATA_SOURCE_NAME + " is saved"); | ||
|
||
return internalStorageDs; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
wfe-core/src/main/java/ru/runa/wfe/lang/bpmn2/DataStore.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package ru.runa.wfe.lang.bpmn2; | ||
|
||
import ru.runa.wfe.execution.ExecutionContext; | ||
import ru.runa.wfe.lang.Node; | ||
import ru.runa.wfe.lang.NodeType; | ||
|
||
public class DataStore extends Node { | ||
@Override | ||
public NodeType getNodeType() { | ||
return NodeType.TEXT_ANNOTATION; | ||
} | ||
|
||
@Override | ||
protected void execute(ExecutionContext executionContext) throws Exception { | ||
throw new UnsupportedOperationException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
wfe-core/src/main/java/ru/runa/wfe/security/SecurityCheckProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package ru.runa.wfe.security; | ||
|
||
import ru.runa.wfe.commons.PropertyResources; | ||
|
||
public class SecurityCheckProperties { | ||
public static final String CONFIG_FILE_NAME = "securitycheck.properties"; | ||
private static final PropertyResources RESOURCES = new PropertyResources(CONFIG_FILE_NAME); | ||
|
||
public static boolean isPermissionCheckRequired(SecuredObjectType securedObjectType) { | ||
return RESOURCES.getBooleanProperty("permission.check.required." + securedObjectType.getName(), false); | ||
} | ||
} |
Oops, something went wrong.