xref: /haiku/src/apps/haikudepot/server/ServerReferenceDataUpdateProcess.h (revision ed24eb5ff12640d052171c6a7feba37fab8a75d1)
1 /*
2  * Copyright 2019-2020, Andrew Lindesay <apl@lindesay.co.nz>.
3  * All rights reserved. Distributed under the terms of the MIT License.
4  */
5 #ifndef SERVER_REFERENCE_DATA_UPDATE_PROCESS_H
6 #define SERVER_REFERENCE_DATA_UPDATE_PROCESS_H
7 
8 
9 #include "AbstractSingleFileServerProcess.h"
10 
11 #include <File.h>
12 #include <Path.h>
13 #include <String.h>
14 #include <Url.h>
15 
16 #include "Model.h"
17 #include "PackageInfo.h"
18 
19 
20 #undef B_TRANSLATION_CONTEXT
21 #define B_TRANSLATION_CONTEXT "ServerReferenceDataUpdateProcess"
22 
23 class DumpExportReference;
24 
25 class ServerReferenceDataUpdateProcess : public AbstractSingleFileServerProcess
26 {
27 public:
28 
29 								ServerReferenceDataUpdateProcess(
30 									Model* model, uint32 serverProcessOptions);
31 	virtual						~ServerReferenceDataUpdateProcess();
32 
33 			const char*			Name() const;
34 			const char*			Description() const;
35 
36 protected:
37 			status_t			GetStandardMetaDataPath(BPath& path) const;
38 			void				GetStandardMetaDataJsonPath(
39 									BString& jsonPath) const;
40 
41 			BString				UrlPathComponent();
42 			status_t			ProcessLocalData();
43 			status_t			GetLocalPath(BPath& path) const;
44 
45 private:
46 			status_t			_ProcessData(DumpExportReference* data);
47 			status_t			_ProcessNaturalLanguages(
48 									DumpExportReference* data);
49 			status_t			_ProcessPkgCategories(
50 									DumpExportReference* data);
51 			status_t			_ProcessRatingStabilities(
52 									DumpExportReference* data);
53 
54 private:
55 			Model*				fModel;
56 
57 };
58 
59 #endif // SERVER_REFERENCE_DATA_UPDATE_PROCESS_H
60