Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
WE.SpreadsheetImport
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Labels
Merge Requests
0
Merge Requests
0
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
packages
WE.SpreadsheetImport
Commits
2ac59f82
Commit
2ac59f82
authored
Oct 31, 2016
by
Chivy Lim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IMP] Ignore broken file resource on importing
refs KIME-4681
parent
94b2bd13
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
Classes/WE/SpreadsheetImport/Command/SpreadsheetImportCommandController.php
...heetImport/Command/SpreadsheetImportCommandController.php
+10
-7
Classes/WE/SpreadsheetImport/Domain/Repository/SpreadsheetImportRepository.php
...tImport/Domain/Repository/SpreadsheetImportRepository.php
+1
-1
No files found.
Classes/WE/SpreadsheetImport/Command/SpreadsheetImportCommandController.php
View file @
2ac59f82
...
...
@@ -13,6 +13,7 @@ namespace WE\SpreadsheetImport\Command;
use
TYPO3\Flow\Annotations
as
Flow
;
use
TYPO3\Flow\Cli\CommandController
;
use
TYPO3\Flow\Exception
;
use
WE\SpreadsheetImport\Domain\Model\SpreadsheetImport
;
/**
...
...
@@ -63,14 +64,16 @@ class SpreadsheetImportCommandController extends CommandController {
// do importing and mark its status as "Completed/Failed"
$this
->
spreadsheetImportService
->
init
(
$spreadsheetImport
);
try
{
$this
->
spreadsheetImportService
->
import
();
// mark importing status as "Completed"
$spreadsheetImport
->
setImportingStatus
(
SpreadsheetImport
::
IMPORTING_STATUS_COMPLETED
);
$this
->
spreadsheetImportRepository
->
update
(
$spreadsheetImport
);
$this
->
outputFormatted
(
'Spreadsheet has been imported. (totalInserted: %d, totalUpdated: %d, totalDeleted: %d, totalSkipped: %d)'
,
array
(
$spreadsheetImport
->
getTotalInserted
(),
$spreadsheetImport
->
getTotalUpdated
(),
$spreadsheetImport
->
getTotalDeleted
(),
$spreadsheetImport
->
getTotalSkipped
()));
}
catch
(
Exception
$e
)
{
$spreadsheetImport
->
setImportingStatus
(
SpreadsheetImport
::
IMPORTING_STATUS_FAILED
);
$this
->
outputFormatted
(
'Spreadsheet imported failed.'
);
}
$this
->
spreadsheetImportRepository
->
update
(
$spreadsheetImport
);
}
else
{
$this
->
outputFormatted
(
'There is no spreadsheet importing in queue.'
);
}
...
...
Classes/WE/SpreadsheetImport/Domain/Repository/SpreadsheetImportRepository.php
View file @
2ac59f82
...
...
@@ -32,7 +32,7 @@ class SpreadsheetImportRepository extends Repository {
public
function
findNextInQueue
()
{
$query
=
$this
->
createQuery
();
$constraint
=
$query
->
logicalAnd
(
$query
->
lessThanOrEqual
(
'importingStatus'
,
SpreadsheetImport
::
IMPORTING_STATUS_IN_QUEUE
),
$query
->
equals
(
'importingStatus'
,
SpreadsheetImport
::
IMPORTING_STATUS_IN_QUEUE
),
$query
->
lessThanOrEqual
(
'scheduleDate'
,
new
\DateTime
())
);
return
$query
->
matching
(
$constraint
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment