Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #2

Merged
merged 4 commits into from
Apr 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions docs/Project/exporting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
id: exporting
title: Export to 4D project
---

You can convert an existing 4D database (.4db file) into a 4D project. Since the export only creates a new version of the existing database, original files are never touched. Thus, you can convert your database as many times as you need.

Keep in mind that the export is a one-way operation:

- once a 4D database has been exported as a project, both versions become independant.
- a 4D project cannot be exported to a .4db file


## Converting a database

When you convert an existing 4D database to a project, the .4db file is left untouched: a "Project" folder is created next to your .4db file, and will contain all necessary files.

**Note:** If a "Project" folder already exists at the same level as your .4db file (for example if a conversion has been done already), it will be replaced by the conversion process.

To convert a database to a project:

1. Open the database to convert.
2. Select **File > Export > Structure to project**.
![](../assets/en/exportProj.png)
**Notes:**
- This command is only available if the database is open in classic (binary) mode.
- You can also use the **Export structure file** language command.

If the conversion was successful and no blocking errors encountered, the following dialog box is diplayed:
![](../assets/en/exportProj2.png)

- **Reveal log**: highlights the conversion log file on your disk. Reading this file is highly recommenced in any case since the conversion process could have modified some parts of the application (see [Check the conversion](#check-the-conversion)).

- **Open project**: restarts the 4D application and loads the converted project.

### About the data file

The data file is left untouched by the conversion. Only development elements are converted. You can open the data file with the .4db structure file after a conversion.

## Resulting project

During the conversion process, a new "Project" folder is created at the same level as your .4db structure file. It contains all your development as text files: forms, structure, methods, triggers, menus, tips, lists. It also contains a ".4DProject" file, which is your converted 4D project main file:

![](../assets/en/exportProj3.png)

When you open the "<name>.4DProject" file with your 4D application, the project uses the same resources folder and web folder as the existing "<name>.4db" file, which makes it easier to test your project.

You can still open the "<name>.4db" database, do some modifications if required (see below), then export again, and test. You can repeat this operation until you are satisfied with the conversion.

## Check the conversion

A log file is created by default during the conversion to reference all issues that required an action from the converter. The log file is in JSON format. In the file, messages are classified in three categories ("severity" property), for example:

```codejs
{
"message": "Exporting picture id:1, name:logo.png, types:.png to <...>:Resources:Images:library:logo.png",
"severity": "info"
}
```

- **info**: describes a necessary action executed automatically by the converter and that will not have any impact on the application interface or features. For example, if you have images in the pictures library, 4D exports them to the **resources** folder of the database (see example above).

- **warning**: describes a necessary action executed automatically by the converter that could lead to differences in the application's features or interface, but without preventing the database to run. Warnings usually require that you control the impact of the conversion on your code. For example, warnings are returned when unsupported compatibility settings, such as "Unicode mode" or "Radio buttons grouped by name" are automatically switched.

- **error**: describes an issue that requires your intervention to be fixed. It can prevent the database to run properly. For example, some old form objects are no longer supported, such as highlight buttons. In this case, you must convert yourself the button to a 3D button in the .4db file before relaunching the consersion.


When edits are required in the .4db database, just modify the code or the form accordingly and export the structure again, until you are satisfied with the result.


## Compatibility issues

In 4D projects, we have removed the support of obsolete features in order to focus on new, modern implementations. In particular:

- The picture library no longer exists. During conversion, 4D exports all your images to the **resources** folder of the database.
- Legacy style sheets are not converted.
- Groups and users are not converted.
- Form objects and form object properties have been updated (they now use the same grammar as for Dynamic forms). Deprecated parts are not supported (see [Legacy form objects and properties on Doc Center](https://doc.4d.com/4Dv17R4/4D/17-R4/Deprecated-or-removed-features-in-v17-product-range.200-4075256.en.html#4020272))'. In fact, we use the same grammar used for Dynamic forms.
- Compatibility settings are reset as for a new database. Check the Conversion log to verify the status of compatibility settings for your database.


## And after?

Once your are satisfied with your converted database and want to start working with your project, you can clean up your working directory:

1. Remove your ".4db" and ".4dindy" files from the application folder (you can move them to a backup directory for example).
2. On macOS, remove the ".4dbase" folder extension during the whole development phase. Since you work with
20 changes: 10 additions & 10 deletions docs/Project/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ id: overview
title: Overview
---

Developing a 4D application can be done in two different modes:
A 4D project is a 4D application where all the development is stored into several text-based, human-readable files.

- **binary mode**: all design elements (methods, forms, structure...) are gathered in a single, compact binary file, the ".4db" file. This mode was the only available mode until 4D v18.
- **project mode**: all design elements are stored in separate, text-based, human-readable files.

The project mode provides an alternative way to develop in 4D using a text-based rather than binary-based mode. The 4D project mode combines the power of the 4D development platform with the versatility of lightweight, distributed work.

Fully functional 4D applications are created from end-to-end via multiple files within a single 4D Project. These files contain everything from the structure of an application, to its code, and even the application’s settings and user preferences.
Fully functional 4D applications are created from end-to-end via multiple files within a single 4D project. These files contain everything from the structure of an application, to its code, and even the application’s settings and user preferences.

Because file formats in 4D Project Mode are text-based (JSON, XML, etc.), they are easy to read and understand by both new and experienced developers. Their compact size increases opportunities to work collaboratively by being easy to:
Because file formats in projects are in plain text (JSON, XML, etc.), they are easy to read and understand by both new and experienced developers. Their compact size increases opportunities to work collaboratively by being easy to:

- Program generically
- Customize code
- Share files
- Create templates

The flexibility of developing applications in 4D Project Mode is especially demonstrated when multiple developers need to work on the same part of an application, at the same time. 4D Project files are ideal for defining modules and storing them in a source control repository (Perforce, Git, SVN, etc.), allowing development teams to take advantage of features such as:
The flexibility of developing a 4D project is especially demonstrated when multiple developers need to work on the same part of an application, at the same time. 4D Project files are ideal for defining modules and storing them in a source control repository (Perforce, Git, SVN, etc.), allowing development teams to take advantage of features such as:

- Versioning
- Revision Comparisons
- Rollbacks

4D Project Mode is a feature-rich, robust framework equivalent to 4D Binary Mode with only minor differences between the two such as the architecture, administration tools, and the approach to working in teams. Creating applications in 4D Project Mode, whether it’s interpreted or compiled, has no differences for end users.
To create a 4D project, you have two possibilities:

- create a new, empty project
- export an existing 4D "binary" development -- which can require adaptations to handle compatibility issues.

4D project-based applications can be compiled and easily deployed in single-user or client/server architecture through compressed files.
Binary file added docs/assets/en/exportProj.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/en/exportProj2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/en/exportProj3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions website/pages/en/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,12 @@ const Description = props => (
<Block background="light" layout="twoColumn">
{[
{
content: '[4D Language Concepts](docs/Concepts/doc1.html)',
//<br>[4D Project Development (BETA)](docs/Project/overview.html)',
content: '[4D Language Concepts](docs/Concepts/doc1.html)',
//<br>4D Projects (BETA)'
//(docs/Project/overview.html)'
image: imgUrl('manuals.png'),
imageAlign: 'left',
title: 'Manuals',
title: 'Reference Guides',
}


Expand All @@ -179,9 +180,9 @@ const Classic = props => (
{[
{
content: '[doc.4d.com](https://doc.4d.com/)',
image: imgUrl('Classic.png'),
image: imgUrl('classic.png'),
imageAlign: 'left',
title: 'Classic Documentation',
title: 'Doc Center',
},


Expand Down
4 changes: 3 additions & 1 deletion website/sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
},
"Concepts/error-handling","Concepts/interpreted-compiled",
"Concepts/components","Concepts/plug-ins","Concepts/identifiers"
]
],
"4D Projects":
["Project/overview","Project/exporting"]
}
}
6 changes: 3 additions & 3 deletions website/siteConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const users = [
];

const siteConfig = {
title: 'Developer Center' /* title for your website */,
tagline: 'Documentation for 4D Developers',
title: 'Documentation' /* title for your website */,
tagline: 'Essential Guides for 4D Developers',
url: 'https://4d.github.io' /* your website url */,
//baseUrl: '/doc/' /* base url for your project */,
baseUrl: '/docs/' /* base url for your project */,
Expand All @@ -41,7 +41,7 @@ const siteConfig = {
headerLinks: [
//{doc: 'Concepts/doc1', label: '4D Language Concepts'},
//{doc: 'doc4', label: 'page4'},
{href: 'https://4d.com/', label: '4d.com'},
{href: 'https://developer.4d.com/', label:'Developer Center'},
//{href: 'http://kb.4d.com/', label: 'knowledgebase'},
//{page: 'help', label: 'Help'},
//{blog: false, label: 'Blog'},
Expand Down