Skip to content

Commit

Permalink
manually recreate a new design for the python section of the document…
Browse files Browse the repository at this point in the history
… builder one

Co-authored-by: vanyauhalin <[email protected]>
  • Loading branch information
ovchinnikova-natalya and vanyauhalin committed Nov 19, 2024
1 parent 141ef31 commit bcfd7f5
Show file tree
Hide file tree
Showing 52 changed files with 1,247 additions and 279 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
`def CloseFile(self);`
```yml signature
- {type: keyword, text: def}
- {type: text, text: " "}
- {type: entity, text: CloseFile}
- {type: text, text: (}
- {type: parameter, text: self}
- {type: text, text: )}
```
## Description
Closes the file to stop working with it. You can use a single **ONLYOFFICE Document Builder** instance to work with all your files, but you need to close the previous file before you can start working with the next one in this case.
Closes the file to stop working with it. You can use a single ONLYOFFICE Document Builder instance to work with all your files, but you need to close the previous file before you can start working with the next one in this case.
## Example
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,37 @@
`def CreateFile(self, type);`
```yml signature
- {type: keyword, text: def}
- {type: text, text: " "}
- {type: entity, text: CreateFile}
- {type: text, text: (}
- {type: parameter, text: self}
- {type: text, text: ", "}
- {type: parameter, text: type}
- {type: text, text: ": "}
- {type: type, text: int}
- {type: text, text: " | "}
- {type: type, text: str}
- {type: text, text: )}
```
## Description
Creates a new file. The type of the file which will be created needs to be set.
## Parameters
| Name | Type | Description |
| ------ | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| *type* | int \| str | The type of the file to be created set as a hexadecimal integer for the Python code or **docx**, **xlsx**, **pptx**, or **pdf** for the *.docbuilder* script file (see [OFFICESTUDIO\_FILE\_XXX](../../../../Builder%20App/Overview/index.md#format-types) values). |
<parameters>
- type
```yml signature.variant="inline"
- {type: type, text: int}
- {type: text, text: " | "}
- {type: type, text: str}
```
- : The type of the file to be created set as a hexadecimal integer for the Python code or `docx`, `xlsx`, `pptx`, or `pdf` for the `.docbuilder` script file (see [OFFICESTUDIO\_FILE\_XXX](../../../../Builder%20App/Overview/index.md#format-types) values).

</parameters>

## Example

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
`def Dispose(cls);`
```yml signature
- {type: keyword, text: def}
- {type: text, text: " "}
- {type: entity, text: Dispose}
- {type: text, text: (}
- {type: parameter, text: cls}
- {type: text, text: )}
```
## Description
Unloads the **ONLYOFFICE Document Builder** from the application memory when it is no longer needed. Generally, there is no need to dispose JS before exiting the process, it should happen automatically. It should only be used if the process needs the resources taken up by JS.
Unloads the ONLYOFFICE Document Builder from the application memory when it is no longer needed. Generally, there is no need to dispose JS before exiting the process, it should happen automatically. It should only be used if the process needs the resources taken up by JS.
> Please note, that for the *.docbuilder* file the *CDocBuilder.Dispose* method is not used.
> Please note, that for the `.docbuilder` file the `CDocBuilder.Dispose` method is not used.

## Example

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,53 @@
`def ExecuteCommand(self, command, retValue=None);`
```yml signature
- {type: keyword, text: def}
- {type: text, text: " "}
- {type: entity, text: ExecuteCommand}
- {type: text, text: (}
- {type: parameter, text: self}
- {type: text, text: ", "}
- {type: parameter, text: command}
- {type: text, text: ": "}
- {type: type, text: str}
- {type: text, text: ", "}
- {type: parameter, text: retValue}
- {type: text, text: ": "}
- {id: ../../CDocBuilderValue/index.md, token: {type: type, text: CDocBuilderValue}}
- {type: text, text: " | "}
- {type: type, text: None}
- {type: text, text: " = "}
- {type: type, text: None}
- {type: text, text: )}
```
## Description
Executes the command which will be used to create the document file (text document, spreadsheet, presentation, form document, PDF). See the [Text document API](../../../../../Office%20API/Usage%20API/Text%20Document%20API/index.md), [Spreadsheet API](../../../../../Office%20API/Usage%20API/Spreadsheet%20API/index.md), [Presentation API](../../../../../Office%20API/Usage%20API/Presentation%20API/index.md), or [Form API](../../../../../Office%20API/Usage%20API/Form%20API/index.md) sections for more information which commands are available for various document types.
> Please note, that for the *.docbuilder* file the *CDocBuilder.ExecuteCommand* method is not used explicitly. The command itself is used instead. See the example below.
> Please note, that for the `.docbuilder` file the `CDocBuilder.ExecuteCommand` method is not used explicitly. The command itself is used instead. See the example below.

## Parameters

| Name | Type | Description |
| ---------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| *command* | str | The command in the form of JavaScript code which will be used to create the document file (in Python, the escape character must be used when the command contains quotation symbols). |
| *retValue* | CDocBuilderValue | The command return value. |
<parameters>

- command

```yml signature.variant="inline"
- {type: type, text: str}
```

- : The command in the form of JavaScript code which will be used to create the document file (in Python, the escape character must be used when the command contains quotation symbols).

- retValue, default: None

```yml signature.variant="inline"
- {id: ../../CDocBuilderValue/index.md, token: {type: type, text: CDocBuilderValue}}
- {type: text, text: " | "}
- {type: type, text: None}
```

- : The command return value.

</parameters>

## Example

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
`def GetContext(self);`
```yml signature
- {type: keyword, text: def}
- {type: text, text: " "}
- {type: entity, text: GetContext}
- {type: text, text: (}
- {type: parameter, text: self}
- {type: text, text: )}
```
## Description
Returns the current JS [context](../../CDocBuilderContext/index.md).
> Please note, that for the *.docbuilder* file the *CDocBuilder.GetContext* method is not used.
> Please note, that for the `.docbuilder` file the `CDocBuilder.GetContext` method is not used.

## Example

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
`def GetVersion(self);`
```yml signature
- {type: keyword, text: def}
- {type: text, text: " "}
- {type: entity, text: GetVersion}
- {type: text, text: (}
- {type: parameter, text: self}
- {type: text, text: )}
```
## Description
Returns the **ONLYOFFICE Document Builder** engine version.
Returns the ONLYOFFICE Document Builder engine version.
> Please note, that for the *.docbuilder* file the *CDocBuilder.GetVersion* method is not used.
> Please note, that for the `.docbuilder` file the `CDocBuilder.GetVersion` method is not used.

## Example

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,41 @@
`def Initialize(cls, directory=None);`
```yml signature
- {type: keyword, text: def}
- {type: text, text: " "}
- {type: entity, text: Initialize}
- {type: text, text: (}
- {type: parameter, text: cls}
- {type: text, text: ", "}
- {type: parameter, text: directory}
- {type: text, text: ": "}
- {type: type, text: str}
- {type: text, text: " | "}
- {type: type, text: None}
- {type: text, text: " = "}
- {type: type, text: None}
- {type: text, text: )}
```
## Description
Initializes the **ONLYOFFICE Document Builder** as a library for the application to be able to work with it. This method just sets the directory to the main Document Builder resources (icu files, etc). If this method is not called, the Document Builder will find resources from the current process directory.
Initializes the ONLYOFFICE Document Builder as a library for the application to be able to work with it. This method just sets the directory to the main Document Builder resources (icu files, etc). If this method is not called, the Document Builder will find resources from the current process directory.
> Please note, that for the *.docbuilder* file the *CDocBuilder.Initialize* method is not used.
> Please note, that for the `.docbuilder` file the `CDocBuilder.Initialize` method is not used.

## Parameters

| Name | Type | Description |
| --------- | ---- | ------------------------------------------------ |
| directory | str | The path to the main Document Builder resources. |
<parameters>

- directory, default: None

```yml signature.variant="inline"
- {type: type, text: str}
- {type: text, text: " | "}
- {type: type, text: None}
```

- : The path to the main Document Builder resources.

</parameters>

## Example

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
`def IsSaveWithDoctrendererMode(self);`
```yml signature
- {type: keyword, text: def}
- {type: text, text: " "}
- {type: entity, text: IsSaveWithDoctrendererMode}
- {type: text, text: (}
- {type: parameter, text: self}
- {type: text, text: )}
```
## Description
Specifies if the doctrenderer mode is used when building a document or getting content from the editor when saving a file.
> Please note, that for the *.docbuilder* file the *CDocBuilder.IsSaveWithDoctrendererMode* method is not used.
> Please note, that for the `.docbuilder` file the `CDocBuilder.IsSaveWithDoctrendererMode` method is not used.

## Example

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,60 @@
`def OpenFile(self, path, params);`
```yml signature
- {type: keyword, text: def}
- {type: text, text: " "}
- {type: entity, text: OpenFile}
- {type: text, text: (}
- {type: parameter, text: self}
- {type: text, text: ", "}
- {type: parameter, text: path}
- {type: text, text: ": "}
- {type: type, text: str}
- {type: text, text: ", "}
- {type: parameter, text: params}
- {type: text, text: ": "}
- {type: type, text: str}
- {type: text, text: " | "}
- {type: type, text: None}
- {type: text, text: )}
```
## Description
Opens the document file which will be edited and saved afterwards.
## Parameters
| Name | Type | Attributes | Description |
| -------- | ---- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| *path* | str | | The path to the file to be opened together with its name and extension. |
| *params* | str | \<optional> | The parameters needed for the correct file opening (most commonly, the encoding is used for the *txt* and *csv* file types or the delimiter for the *csv* files, for other file types this is just an empty string). The parameters are added in the form of XML tags, where **m\_nCsvTxtEncoding** is used for the text encoding and **m\_nCsvDelimiter** is used for the **delimiter. You can find all the supported values for the encoding [in this file](https://github.com/ONLYOFFICE/server/blob/master/Common/sources/commondefines.js). The supported values for the *csv* delimiters include:<br/><br/>**0** - no delimiter;<br/><br/>**1** - tab;<br/><br/>**2** - semicolon;<br/><br/>**3** - colon;<br/><br/>**4** - comma;<br/><br/>**5** - space |
<parameters>
- path
```yml signature.variant="inline"
- {type: type, text: str}
```
- :
The path to the file to be opened together with its name and extension.
- params
```yml signature.variant="inline"
- {type: type, text: str}
- {type: text, text: " | "}
- {type: type, text: None}
```
- :
The parameters needed for the correct file opening (most commonly, the encoding is used for the `txt` and `csv` file types or the delimiter for the `csv` files, for other file types this is just an empty string). The parameters are added in the form of XML tags, where `m_nCsvTxtEncoding` is used for the text encoding and `m_nCsvDelimiter` is used for the delimiter. You can find all the supported values for the encoding [in this file](https://github.com/ONLYOFFICE/server/blob/master/Common/sources/commondefines.js). The supported values for the `csv` delimiters include:

- `0` - no delimiter;
- `1` - tab;
- `2` - semicolon;
- `3` - colon;
- `4` - comma;
- `5` - space.

</parameters>

## Example

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
`def Run(self, path);`
```yml signature
- {type: keyword, text: def}
- {type: text, text: " "}
- {type: entity, text: Run}
- {type: text, text: (}
- {type: parameter, text: self}
- {type: text, text: ", "}
- {type: parameter, text: path}
- {type: text, text: ": "}
- {type: type, text: str}
- {type: text, text: )}
```
## Description
Runs the **ONLYOFFICE Document Builder** executable. If you do not want to write a Python application, you can simply use the **docbuilder.exe** executable file and run it with the ### .docbuilder file as an argument, where all the code for the document file creation will be written. For Python, create the *CDocBuilder* object and call the *Run* method with the path to the executable file from the *path* parameter.
Runs the ONLYOFFICE Document Builder executable. If you do not want to write a Python application, you can simply use the `docbuilder.exe` executable file and run it with the `.docbuilder` file as an argument, where all the code for the document file creation will be written. For Python, create the `CDocBuilder` object and call the `Run` method with the path to the executable file from the `path` parameter.

## Parameters

| Name | Type | Description |
| ------ | ---- | ----------------------------------------------------------- |
| *path* | str | The path to the **ONLYOFFICE Document Builder** executable. |
<parameters>

- path

```yml signature.variant="inline"
- {type: type, text: str}
```

- : The path to the ONLYOFFICE Document Builder executable.

</parameters>

## Example

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,35 @@
`def RunText(self, commands);`
```yml signature
- {type: keyword, text: def}
- {type: text, text: " "}
- {type: entity, text: RunText}
- {type: text, text: (}
- {type: parameter, text: self}
- {type: text, text: ", "}
- {type: parameter, text: commands}
- {type: text, text: ": "}
- {type: type, text: str}
- {type: text, text: )}
```
## Description
Runs all the commands for the document creation using a single command. Compared to [CDocBuilder.ExecuteCommand](../ExecuteCommand/index.md) where only one command at a time is allowed, *CDocBuilder.RunText* makes it possible to enter all the commands for the document creation at once.
Runs all the commands for the document creation using a single command. Compared to [CDocBuilder.ExecuteCommand](../ExecuteCommand/index.md) where only one command at a time is allowed, `CDocBuilder.RunText` makes it possible to enter all the commands for the document creation at once.

> Please note, that for the *.docbuilder* file the *CDocBuilder.RunText* method is not used.
> Please note, that for the `.docbuilder` file the `CDocBuilder.RunText` method is not used.

## Parameters

| Name | Type | Description |
| ---------- | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| *commands* | str | The commands which will be used to create the document file (in Python, the escape character must be used when the command contains quotation symbols). All the commands containing *builder.* are line separated, i.e. you cannot write them in one line, each command **must** start with its own line. |
<parameters>

- commands

```yml signature.variant="inline"
- {type: type, text: str}
```

- : The commands which will be used to create the document file (in Python, the escape character must be used when the command contains quotation symbols). All the commands containing `builder.` are line separated, i.e. you cannot write them in one line, each command must start with its own line.

</parameters>

## Example

Expand Down
Loading

0 comments on commit bcfd7f5

Please sign in to comment.