-
Notifications
You must be signed in to change notification settings - Fork 4
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
1 parent
46b8efe
commit dc22d9f
Showing
113 changed files
with
2,828 additions
and
705 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
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
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
4 changes: 2 additions & 2 deletions
4
confluence-plugin/src/main/java/com/networkedassets/git4c/core/business/ConverterPlugin.kt
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
package com.networkedassets.git4c.core.bussiness | ||
|
||
import com.networkedassets.git4c.core.business.ExtractionResult | ||
import com.networkedassets.git4c.core.business.Macro | ||
import com.networkedassets.git4c.data.macro.documents.item.ConvertedDocumentsItem | ||
import com.networkedassets.git4c.data.macro.documents.item.DocumentsItem | ||
|
||
interface ConverterPlugin : Plugin { | ||
fun convert(fileData: ImportedFileData, extractionResult: ExtractionResult): ConvertedDocumentsItem? | ||
fun convert(fileData: ImportedFileData, extractionResult: ExtractionResult, macro: Macro): ConvertedDocumentsItem? | ||
} |
11 changes: 11 additions & 0 deletions
11
confluence-plugin/src/main/java/com/networkedassets/git4c/core/business/FileIgnorer.kt
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,11 @@ | ||
package com.networkedassets.git4c.core.business | ||
|
||
import com.networkedassets.git4c.core.bussiness.ImportedFileData | ||
|
||
/** | ||
* For given file FileIgnorer returns list of files that shouldn't be converted | ||
*/ | ||
interface FileIgnorer { | ||
fun getFilesToIgnore(fileData: ImportedFileData): List<String> | ||
fun supportedExtensions(): List<String> | ||
} |
19 changes: 19 additions & 0 deletions
19
confluence-plugin/src/main/java/com/networkedassets/git4c/core/business/FileIgnorerList.kt
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,19 @@ | ||
package com.networkedassets.git4c.core.business | ||
|
||
import com.networkedassets.git4c.core.bussiness.ImportedFileData | ||
|
||
class FileIgnorerList( | ||
private vararg val ignorers: FileIgnorer | ||
): FileIgnorer { | ||
|
||
override fun getFilesToIgnore(fileData: ImportedFileData): List<String> { | ||
if (!extentions.contains(fileData.extension)) return emptyList() | ||
val ignorer = ignorers.first { it.supportedExtensions().contains(fileData.extension) } | ||
return ignorer.getFilesToIgnore(fileData) | ||
} | ||
|
||
override fun supportedExtensions() = extentions.toList() | ||
|
||
private val extentions by lazy { ignorers.flatMap { it.supportedExtensions() }.toSet() } | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
confluence-plugin/src/main/java/com/networkedassets/git4c/core/business/Macro.kt
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 |
---|---|---|
@@ -1,10 +1,20 @@ | ||
package com.networkedassets.git4c.core.business | ||
|
||
import com.networkedassets.git4c.data.MacroSettings | ||
|
||
data class Macro(val uuid: String, val type: MacroType) { | ||
constructor() : this("", MacroType.SINGLEFILE) | ||
|
||
enum class MacroType { | ||
MULTIFILE, | ||
SINGLEFILE | ||
} | ||
|
||
companion object { | ||
fun from(macroSettings: MacroSettings): Macro { | ||
val macroType = Macro.MacroType.valueOf(macroSettings.type?.name ?: MacroType.SINGLEFILE.name) | ||
val macro = Macro(macroSettings.uuid, macroType) | ||
return macro | ||
} | ||
} | ||
} |
Oops, something went wrong.