Skip to content

Commit 59abc03

Browse files
committed
Documentation created automatically
1 parent bcc3a94 commit 59abc03

32 files changed

+664
-27
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@
1919

2020
# Go workspace file
2121
go.work
22+
23+
# Runtime configuration files
24+
.alfresco
25+
alfresco.log

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ LINUX=$(EXECUTABLE)_linux_amd64
44
DARWIN=$(EXECUTABLE)_darwin_arm64
55
VERSION=$(shell git describe --tags --always --long --dirty)
66

7-
.PHONY: all test clean
7+
.PHONY: all test clean docs
88

9-
all: test build
9+
all: test build docs
1010

1111
build: test windows linux darwin
1212
@echo version: $(VERSION)
@@ -29,6 +29,9 @@ $(DARWIN):
2929
test:
3030
cd test && ./test_node.sh
3131

32+
docs:
33+
go build ./docs/generate/generate.go && cd docs/generate && ./generate
34+
3235
clean:
3336
go clean
3437
rm -f $(WINDOWS) $(LINUX) $(DARWIN)

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,15 @@ a8e32ff6-6140-4a19-84a5-c157820fc376
171171

172172
Sample bash scripts for testing purposes are provided in [test](test) folder.
173173

174+
## Documentation
175+
176+
Detailed documentation is available in [docs/alfresco.md](docs/alfresco.md)
177+
174178
## TODO
175179

176-
* Automated testing
177180
* Site commands
178181
* Person commands
179182
* Group commands
180183
* Search commands
181184
* Provide pre-built programs for Windows, Linux, Mac AMD64 & Mac ARM64
182-
* Control concurrency rate
183-
* [Generate documentation automatically](https://github.com/spf13/cobra/blob/main/doc/md_docs.md)
185+
* Control concurrency rate

cmd/config/config.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import (
77

88
var ConfigCmd = &cobra.Command{
99
Use: "config",
10-
Short: "Connection details",
10+
Short: "Manage ACS connection details",
11+
Long: `ACS Client configuration is stored on a local ".alfresco" file.
12+
Credentials (username and password) are stored on a Native Store depending on the OS.
13+
The access to the Native Store may require typing OS credentials.`,
1114
}
1215

1316
func init() {

cmd/config/delete.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ const ConfigDeleteCmdId string = "[CONFIG DELETE]"
1313

1414
var configDeleteCmd = &cobra.Command{
1515
Use: "delete",
16-
Short: "Connection details removal",
16+
Short: "ACS connection details removal",
17+
Long: `ACS Client configuration is removed from local ".alfresco" file.
18+
Credentials (username and password) are removed from Native Store.`,
1719
Run: func(command *cobra.Command, args []string) {
1820
storedServer := viper.GetString(nativestore.UrlLabel)
1921
_err := nativestore.Delete(storedServer)

cmd/config/get.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ const ConfigGetCmdId string = "[CONFIG GET]"
1414

1515
var configGetCmd = &cobra.Command{
1616
Use: "get",
17-
Short: "Get connection details",
17+
Short: "Get ACS connection details",
18+
Long: `ACS Client configuration and credentials are retrieved.
19+
The access to the Native Store may require typing OS credentials.`,
1820
Run: func(command *cobra.Command, args []string) {
1921
storedServer := viper.GetString(nativestore.UrlLabel)
2022
username, password, _err := nativestore.Get(storedServer)

cmd/config/set.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ var insecure bool
1919
var maxItems int
2020
var configSetCmd = &cobra.Command{
2121
Use: "set",
22-
Short: "Connection details storage",
22+
Short: "ACS connection details storage",
23+
Long: `ACS Client configuration is stored on a local ".alfresco" file.
24+
Credentials (username and password) are stored on a Native Store depending on the OS.
25+
The access to the Native Store may require typing OS credentials.
26+
When using TLS, "insecure" flag can be set to "true" to allow connections to ACS servers using self-signed certificates.`,
2327
Run: func(command *cobra.Command, args []string) {
2428
_err := nativestore.Set(server, username, password)
2529
if _err != nil {

cmd/node/create.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ var propertiesCreate []string
7878
var fileNameCreate string
7979
var nodeCreateCmd = &cobra.Command{
8080
Use: "create",
81-
Short: "Create new Node",
81+
Short: "Create new Node in ACS Repository",
82+
Long: `Creates a new node as children of a parent node in the repository.
83+
The node can be created setting only metadata (name, type, aspects and properties) or
84+
a local file can be also specified to be associated as the content of the new node.`,
8285
Run: func(command *cobra.Command, args []string) {
8386
CreateNode(nodeId,
8487
nodeNameCreate,
@@ -96,12 +99,12 @@ var nodeCreateCmd = &cobra.Command{
9699

97100
func init() {
98101
nodeCmd.AddCommand(nodeCreateCmd)
99-
nodeCreateCmd.Flags().StringVarP(&nodeId, "nodeId", "i", "", "Parent Node Id in Alfresco Repository. The node is created under this Parent Node. You can also use one of these well-known aliases: -my-, -shared-, -root-")
100-
nodeCreateCmd.Flags().StringVarP(&relativePath, "relativePath", "r", "", "A path in Alfresco Repository relative to the nodeId.")
101-
nodeCreateCmd.Flags().StringVarP(&nodeNameCreate, "name", "n", "", "Node Name")
102-
nodeCreateCmd.Flags().StringVarP(&nodeTypeCreate, "type", "t", "", "Node Type")
103-
nodeCreateCmd.Flags().StringArrayVarP(&aspectsCreate, "aspects", "a", nil, "Complete aspect list to be set")
104-
nodeCreateCmd.Flags().StringArrayVarP(&propertiesCreate, "properties", "p", nil, "Property=Value list containing properties to be updated")
102+
nodeCreateCmd.Flags().StringVarP(&nodeId, "nodeId", "i", "", "Parent Node Id in Alfresco Repository (commonly a folder node). The node is created under this Parent Node. You can also use one of these well-known aliases: -my-, -shared-, -root-")
103+
nodeCreateCmd.Flags().StringVarP(&relativePath, "relativePath", "r", "", "A path in Alfresco Repository relative to the nodeId for the Parent Node.")
104+
nodeCreateCmd.Flags().StringVarP(&nodeNameCreate, "name", "n", "", "New Node Name")
105+
nodeCreateCmd.Flags().StringVarP(&nodeTypeCreate, "type", "t", "", "New Node Type")
106+
nodeCreateCmd.Flags().StringArrayVarP(&aspectsCreate, "aspects", "a", nil, "Complete aspect list to be set for the New Node")
107+
nodeCreateCmd.Flags().StringArrayVarP(&propertiesCreate, "properties", "p", nil, "Property=Value list containing properties to be created for the New Node")
105108
nodeCreateCmd.Flags().StringVarP(&fileNameCreate, "file", "f", "", "Filename to be uploaded (complete or local path)")
106109
nodeCreateCmd.Flags().SortFlags = false
107110
nodeCreateCmd.MarkFlagRequired("nodeId")

cmd/node/delete.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ const DeleteNodeCmdId string = "[NODE DELETE]"
1313

1414
var nodeDeleteCmd = &cobra.Command{
1515
Use: "delete",
16-
Short: "Delete Node",
16+
Short: "Delete a Node existing in the repository",
17+
Long: `Removes an existing node from the repository.
18+
Both metadata and content resources are removed.`,
1719
Run: func(command *cobra.Command, args []string) {
1820
if relativePath != "" {
1921
nodeId = GetNodeId(nodeId, relativePath)

cmd/node/download-folder.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ var folderNameDownload string
5858
var wgDownload sync.WaitGroup
5959
var nodeDownloadFolderCmd = &cobra.Command{
6060
Use: "download-folder",
61-
Short: "Download Alfresco Repository folder to local folder",
61+
Short: "Download an Alfresco Repository folder to a local folder",
62+
Long: `Folders and files nodes from the repository are retrieved recursively.
63+
Only content is downloaded, while metadata is not available on the local download`,
6264
Run: func(command *cobra.Command, args []string) {
6365

6466
log.Println(NodeUploadFolderCmdId,
@@ -83,6 +85,6 @@ func init() {
8385
nodeCmd.AddCommand(nodeDownloadFolderCmd)
8486
nodeDownloadFolderCmd.Flags().StringVarP(&nodeId, "nodeId", "i", "", "Node Id in Alfresco Repository to download to local folder. You can also use one of these well-known aliases: -my-, -shared-, -root-")
8587
nodeDownloadFolderCmd.Flags().StringVarP(&relativePath, "relativePath", "r", "", "A path in Alfresco Repository relative to the nodeId.")
86-
nodeDownloadFolderCmd.Flags().StringVarP(&folderNameDownload, "directory", "d", "", "Folder to download Alfresco content")
88+
nodeDownloadFolderCmd.Flags().StringVarP(&folderNameDownload, "directory", "d", "", "Local folder path to download Alfresco content")
8789
nodeDownloadFolderCmd.MarkFlagRequired("nodeId")
8890
}

0 commit comments

Comments
 (0)