File size: 2,556 Bytes
a771826
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Hướng dẫn test với file mmap.txt

## Bước 1: Tạo file .mmap từ XML

File `mmap.txt` của bạn chứa XML thuần. Để test tính năng import, bạn cần tạo file .mmap đúng định dạng (ZIP archive):

### Cách 1: Sử dụng script Python

```python

import zipfile

import os



# Đọc XML từ file

with open('mmap.txt', 'r', encoding='utf-8') as f:

    xml_content = f.read()



# Tạo file .mmap (ZIP)

with zipfile.ZipFile('test.mmap', 'w', zipfile.ZIP_DEFLATED) as zipf:

    # Thêm XML vào ZIP với tên Document.xml

    zipf.writestr('Document.xml', xml_content)

    print("Created test.mmap successfully!")

```

Chạy: `python create_mmap.py`

### Cách 2: Thủ công với WinRAR/7-Zip

1. Đổi tên `mmap.txt` thành `Document.xml`
2. Nén file `Document.xml` bằng WinRAR hoặc 7-Zip
3. Đổi extension file nén từ `.zip` thành `.mmap`

### Cách 3: PowerShell (Windows)

```powershell

# Đọc XML

$xmlContent = Get-Content -Path "mmap.txt" -Raw -Encoding UTF8



# Tạo thư mục tạm

$tempDir = "temp_mmap"

New-Item -ItemType Directory -Path $tempDir -Force



# Lưu XML với tên Document.xml

$xmlContent | Out-File -FilePath "$tempDir\Document.xml" -Encoding UTF8



# Tạo ZIP

Compress-Archive -Path "$tempDir\*" -DestinationPath "test.zip" -Force



# Đổi thành .mmap

Move-Item -Path "test.zip" -Destination "test.mmap" -Force



# Dọn dẹp

Remove-Item -Path $tempDir -Recurse -Force



Write-Host "Created test.mmap successfully!"

```

Chạy trong PowerShell: `.\create_mmap.ps1`

## Bước 2: Test import

1. Khởi động ứng dụng:
   ```bash

   npm run start

   ```

2. Mở trình duyệt tại `http://localhost:4200`

3. Click Menu (☰) > Open > Import MindManager (.mmap)

4. Chọn file `test.mmap` đã tạo

5. Mind map của bạn sẽ hiển thị!

## Bước 3: Debug (nếu cần)

Mở Developer Console (F12) để xem log:
- Nếu thành công: sẽ thấy các elements được tạo
- Nếu lỗi: sẽ có error message chi tiết

## Ví dụ kết quả mong đợi

Từ file XML của bạn, sẽ tạo ra:
- 1 rectangle "KẾ HOẠCH GIÁO DỤC LỚP 4 - 5 TUỔI B" (center topic)
- Các rectangles cho các topics con:
  - "ĐẶC ĐIỂM TÌNH HÌNH LỚP"
  - "KẾ HOẠCH GIÁO DỤC NĂM"
  - "KẾ HOẠCH GIÁO DỤC THÁNG"
  - "KẾ HOẠCH HOẠT ĐỘNG VUI CHƠI"
  - "THEO DÕI HỌC SINH"
  - "ĐÁNH GIÁ TRẺ"
- Lines kết nối giữa các topics