Commit 862507d9 authored by Leon Müller's avatar Leon Müller
Browse files

the pre-evaluation commit

parent 845080ba
......@@ -15,11 +15,15 @@ deploy/linux/build/
#mountpoint
mount/
mount2/
#local jsons
src/config.json
src/LocalChangeManager/uncommitedChanges.json
#trellis examples
examples/
......
assets/tutorial/slides/Slide2.png

1.51 MB | W: | H:

assets/tutorial/slides/Slide2.png

1.52 MB | W: | H:

assets/tutorial/slides/Slide2.png
assets/tutorial/slides/Slide2.png
assets/tutorial/slides/Slide2.png
assets/tutorial/slides/Slide2.png
  • 2-up
  • Swipe
  • Onion skin
assets/tutorial/slides/Slide3.png

2.21 MB | W: | H:

assets/tutorial/slides/Slide3.png

1.51 MB | W: | H:

assets/tutorial/slides/Slide3.png
assets/tutorial/slides/Slide3.png
assets/tutorial/slides/Slide3.png
assets/tutorial/slides/Slide3.png
  • 2-up
  • Swipe
  • Onion skin
assets/tutorial/slides/Slide4.png

1.39 MB | W: | H:

assets/tutorial/slides/Slide4.png

2.22 MB | W: | H:

assets/tutorial/slides/Slide4.png
assets/tutorial/slides/Slide4.png
assets/tutorial/slides/Slide4.png
assets/tutorial/slides/Slide4.png
  • 2-up
  • Swipe
  • Onion skin
assets/tutorial/slides/Slide5.png

1.69 MB | W: | H:

assets/tutorial/slides/Slide5.png

1.54 MB | W: | H:

assets/tutorial/slides/Slide5.png
assets/tutorial/slides/Slide5.png
assets/tutorial/slides/Slide5.png
assets/tutorial/slides/Slide5.png
  • 2-up
  • Swipe
  • Onion skin
assets/tutorial/slides/Slide6.png

2.28 MB | W: | H:

assets/tutorial/slides/Slide6.png

1.5 MB | W: | H:

assets/tutorial/slides/Slide6.png
assets/tutorial/slides/Slide6.png
assets/tutorial/slides/Slide6.png
assets/tutorial/slides/Slide6.png
  • 2-up
  • Swipe
  • Onion skin
assets/tutorial/slides/Slide7.png

1.68 MB | W: | H:

assets/tutorial/slides/Slide7.png

1.37 MB | W: | H:

assets/tutorial/slides/Slide7.png
assets/tutorial/slides/Slide7.png
assets/tutorial/slides/Slide7.png
assets/tutorial/slides/Slide7.png
  • 2-up
  • Swipe
  • Onion skin
assets/tutorial/slides/Slide8.png

1.56 MB | W: | H:

assets/tutorial/slides/Slide8.png

1.53 MB | W: | H:

assets/tutorial/slides/Slide8.png
assets/tutorial/slides/Slide8.png
assets/tutorial/slides/Slide8.png
assets/tutorial/slides/Slide8.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -197,7 +197,7 @@ export const ops = {
return process.nextTick(cb, 0, {
bsize: 100000,
frsize: 100000,
blocks: 100000,
blocks: 1000000,
bfree: 100000,
bavail: 100000,
files: 100000,
......@@ -212,13 +212,20 @@ export const ops = {
init: async function(cb:any) {
console.log("Init")
await listContent(pat.join(root,'facts/'));
const resourceID = idFactory.createResourceID(root, 'facts/');
const exists = await service.isResourceExistent(resourceID);
if(exists == true) {
await listContent(pat.join(root,'facts/'));
}
else {
await listContent(pat.join(root,'/'))
}
return cb(0)
},
readdir: async function (path:any, cb:any) {
//console.log('we have a directory to read:' + path)
//resetAutoCommitter();
if(directories.includes(path)) {
if(path=='/') {
var contains = await listContent(pat.join(root,path)); //for starting at root, remove '/facts/' from directory array if using this
......@@ -244,7 +251,7 @@ export const ops = {
directoryTempFiles.push(pat.basename(element))
}
}
return cb(null, contains.concat(directoryTempFiles).filter(x=>(x!=".well-known")&&(x!="activities")&&(x!="processes")&&(x!="broker1"+rdfExtension)))
return cb(null, contains.concat(directoryTempFiles).filter(x=>(x!=".well-known")&&(x!="activities")&&(x!="processes")&&(x!="broker1"+rdfExtension)&&(x!="broker2"+rdfExtension)))
}
else if(tempDirectories.includes(path)) {
......@@ -647,22 +654,22 @@ export const ops = {
setInterval(function() {
if(autoCommitter) {
if(autoCommitter.timerObj) {
if(autoCommitter && autoCommitter.timerObj) {
//if(autoCommitter.timerObj) {
if((global as any).systemStatus == 1 && tempFiles.concat(tempBinaryFiles).concat(deletedResources).filter((y:any)=>!y.includes("/.")).length >0) {
for(const tempFile of tempFiles.concat(tempBinaryFiles).concat(deletedResources).filter((y:any)=>!y.includes("/."))) {
if(!tempFile.includes(" ") && !directories.includes(tempFile)) {
if(!tempFile.includes(" ") /*&& !directories.includes(tempFile)*/) {
//console.log("go: " + tempFile)
updateFile(tempFile);
}
}
}
}
//}
}
else { //if manual committing is enabled
if(tempFiles.concat(tempBinaryFiles).concat(deletedResources).filter((y:any)=>!y.includes("/.")).length >0) {
for(const tempFile of tempFiles.concat(tempBinaryFiles).concat(deletedResources).filter((y:any)=>!y.includes("/."))) {
if(!tempFile.includes(" ") && !directories.includes(tempFile)) {
if(!tempFile.includes(" ") /*&& !directories.includes(tempFile)*/) {
//console.log("go: " + tempFile)
updateFile(tempFile);
}
......@@ -838,6 +845,7 @@ class AutoCommitter {
(global as any).trayStatus.setEnabled(false);
(global as any).trayStatus.setIcon(new QIcon(pat.dirname(__dirname)+"/assets/working.png"));
(global as any).trayStatus.setText('Syncing...');
await(new CommitHandler(commit).commitSelectedChanges()).then(function() {
self.start();
(global as any).systemStatus = 1;
......
import {ProcessLifecycleManager,LdpMementoClient} from "@i5/factlib.js/index";
import { Commit } from './Commit'
import { BinaryFactCandidate } from "@i5/factlib.js/src/datamodels/factdag/candidates/binaryFactCandidate";
const config = require("../config.json")
const fs = require('fs')
const pat = require('path')
const service = new LdpMementoClient();
......@@ -17,6 +15,8 @@ export class CommitHandler {
}
async commitSelectedChanges() {
const config = JSON.parse(fs.readFileSync(pat.join(__dirname,'../src/config.json')));
const fsH = require('../FileSystemHandler/fileSystemHandler')
const uncommittedChanges = {
"Add": fsH.tempFiles.map((x:any)=>x.replace(pat.extname(x),"")).filter((y:any)=>!y.includes("/.")),
......
import {LdpMementoClient} from "@i5/factlib.js/index";
const service = new LdpMementoClient();
const idFactory = service.getIDFactory();
const config = require("../../config.json")
const authorityID = config.ldpAddress
const fs = require('fs')
const pat = require('path')
export async function createDirectory(path:string) {
export async function createDirectory(path:string)
{
const config = JSON.parse(fs.readFileSync(pat.join(__dirname,'../src/config.json')));
const authorityID = config.ldpAddress;
console.log(authorityID)
const resourceID = idFactory.createResourceID(authorityID, path);
await service.createDirectory(resourceID)
await service.createDirectory(resourceID);
}
\ No newline at end of file
import {LdpMementoClient, FactCandidate} from "@i5/factlib.js/index";
const service = new LdpMementoClient();
const idFactory = service.getIDFactory();
const config = require("../../config.json")
const authorityID = config.ldpAddress;
const mountpoint = config.mountpoint;
const fs = require('fs')
const pat = require('path')
const rdf = require('rdflib')
const mime = require('mime-types')
const rdfExtension = config.rdfExtension;
export async function createResourceCandidate(path:string) { //Creates RDF Source Fact Candidates
const config = JSON.parse(fs.readFileSync(pat.join(__dirname,'../src/config.json')));
const authorityID = config.ldpAddress;
const mountpoint = config.mountpoint;
const rdfExtension = config.rdfExtension;
const resourceID = idFactory.createResourceID(authorityID, path);
const isFact = await service.isResourceExistent(resourceID);
//const content = fs.readFileSync(mountpoint+path+rdfExtension).toString();
......@@ -44,6 +45,10 @@ export async function createResourceCandidate(path:string) { //Creates RDF Sourc
}
export async function createBinaryResourceCandidate(path:string) {
const config = JSON.parse(fs.readFileSync(pat.join(__dirname,'../src/config.json')));
const authorityID = config.ldpAddress;
const mountpoint = config.mountpoint;
const extension = pat.extname(path)
path = path.replace(extension,"")
const resourceID = idFactory.createResourceID(authorityID, path);
......
{
"authority": {
"uri": "http://localhost:8081/"
},
"process": {
"checkLatest": false,
"location": "/processes/deletion",
"uses": [],
"generated": []
},
"activity": {
"location": "/activities/deleted"
}
}
import {LdpMementoClient} from "@i5/factlib.js/index";
const service = new LdpMementoClient();
const idFactory = service.getIDFactory();
const config = require("../../config.json")
const authorityID = config.ldpAddress;
const fs = require('fs');
const pat = require('path')
export async function deleteResource(path:string) {
const config = JSON.parse(fs.readFileSync(pat.join(__dirname,'../src/config.json')));
const authorityID = config.ldpAddress;
var resourceID = idFactory.createResourceID(authorityID, path)
await service.deleteResource(resourceID)
}
\ No newline at end of file
......@@ -4,15 +4,17 @@ import {LdpMementoClient,
import { IFactID } from "@i5/factlib.js/src/datamodels/interfaces/IFactID";
const service = new LdpMementoClient();
const config = require("./config.json")
const restorationConfig = require("./config.json")
const fs = require('fs')
const pat = require('path')
export async function restoreRevision(revisionID:IFactID) {
config.authority.uri = revisionID.authorityID;
fs.writeFileSync('./src/LocalChangeManager/restoreRevision/config.json', JSON.stringify(config, null, 2));
const config = JSON.parse(fs.readFileSync(pat.join(__dirname,'../src/config.json')));
restorationConfig.authority.uri = revisionID.authorityID;
restorationConfig.process.location = "/processes/"+config.userID;
fs.writeFileSync('./src/LocalChangeManager/restoreRevision/config.json', JSON.stringify(restorationConfig, null, 2));
const pManager = new ProcessLifecycleManager(config);
const pManager = new ProcessLifecycleManager(restorationConfig);
await pManager.start()
const revision = await service.getSpecificFact(revisionID);
const current = (await service.getLastFactRevision(revisionID)).createCandidate();
......
......@@ -3,12 +3,13 @@ import { CommitHandler } from '../LocalChangeManager/CommitHandler'
import { setTitleBarStyle } from '@nodegui/plugin-title-bar'
import { Info } from "@nodegui/os-utils";
import {fork} from 'child_process'
const config = require("../config.json")
const fs = require('fs')
//const config = require("../config.json")
//-------------------------------------------------------------------------------
const { QMainWindow,QIcon, QToolButton,WidgetEventTypes,QStatusBar,QPushButton, QLabel, QWidget,QGridLayout,ButtonRole, QBoxLayout,QLineEdit,QTextEdit,QGroupBox, QCheckBox,QFileDialog,FileMode,QListWidget,QListWidgetItem, QMessageBox } = require("@nodegui/nodegui");
const mountpoint = config.mountpoint;
const root = config.ldpAddress;
//const mountpoint = config.mountpoint;
//const root = config.ldpAddress;
const pat = require('path')
var helpOpen = false;
......@@ -52,7 +53,8 @@ export class CommitGUI {
changesToCommit:any = [];
constructor() {
this.win.setWindowTitle("Manual Upload");
const config = JSON.parse(fs.readFileSync(pat.join(__dirname,'../src/config.json')));
this.win.setWindowTitle(" Manual Upload: "+config.ldpAddress);
this.win.resize(400,300)
this.win.addEventListener(WidgetEventTypes.PaletteChange, () => {
if(Info.isDarkMode()) {
......@@ -127,11 +129,13 @@ export class CommitGUI {
const forked = fork(pat.join(__dirname,'dialogOpener.js'),['Add used Resources',config.mountpoint])
forked.on('message', (m:any) => {
try {
for(const element of m.map((x:any)=>x.split(pat.basename(mountpoint))[1].replace(pat.extname(x.split(pat.basename(mountpoint))[1]),""))) {
for(const element of m.map((x:any)=>x.split(pat.basename(config.mountpoint))[1].replace(pat.extname(x.split(pat.basename(config.mountpoint))[1]),""))) {
if(!this.selectedFiles.includes(element)) {
//console.log(element)
this.selectedFiles.push(element);
}
}
this.updateUsed();
forked.kill();
}
......@@ -202,6 +206,7 @@ export class CommitGUI {
}
loaduncommittedChanges() {
const config = JSON.parse(fs.readFileSync(pat.join(__dirname,'../src/config.json')));
const fsH = require('../FileSystemHandler/fileSystemHandler')
const uncommittedChanges = {
"Add": fsH.tempFiles.map((x:any)=>x.replace(pat.extname(x),"")).filter((y:any)=>!y.includes("/.")),
......@@ -287,6 +292,7 @@ export class CommitGUI {
}
updateUsed() {
const config = JSON.parse(fs.readFileSync(pat.join(__dirname,'../src/config.json')));
this.usedFacts = [];
var usedArray:any = [];
//clear the displayed labels and display the updated lists
......@@ -297,7 +303,7 @@ export class CommitGUI {
const label = new QListWidgetItem();
label.setText(element);
this.usedWidgets.push(label);
this.usedFacts.push({authority:root,facts:[element]})
this.usedFacts.push({authority:config.ldpAddress,facts:[element]})
this.usedList.addItem(label)
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment