|
a/src/rcldb/rcldoc.cpp |
|
b/src/rcldb/rcldoc.cpp |
|
... |
|
... |
17 |
#include "autoconfig.h"
|
17 |
#include "autoconfig.h"
|
18 |
|
18 |
|
19 |
#include "rcldoc.h"
|
19 |
#include "rcldoc.h"
|
20 |
#include "log.h"
|
20 |
#include "log.h"
|
21 |
#include "rclutil.h"
|
21 |
#include "rclutil.h"
|
|
|
22 |
|
|
|
23 |
using namespace std;
|
22 |
|
24 |
|
23 |
namespace Rcl {
|
25 |
namespace Rcl {
|
24 |
const string Doc::keyabs("abstract");
|
26 |
const string Doc::keyabs("abstract");
|
25 |
const string Doc::keyapptg("rclaptg");
|
27 |
const string Doc::keyapptg("rclaptg");
|
26 |
const string Doc::keyau("author");
|
28 |
const string Doc::keyau("author");
|
|
... |
|
... |
95 |
d->idxi = idxi;
|
97 |
d->idxi = idxi;
|
96 |
d->haspages = haspages;
|
98 |
d->haspages = haspages;
|
97 |
d->haschildren = haschildren;
|
99 |
d->haschildren = haschildren;
|
98 |
d->onlyxattr = onlyxattr;
|
100 |
d->onlyxattr = onlyxattr;
|
99 |
}
|
101 |
}
|
|
|
102 |
|
|
|
103 |
static const string cstr_fileu("file://");
|
|
|
104 |
bool docsToPaths(vector<Rcl::Doc> &docs, vector<string> &paths)
|
|
|
105 |
{
|
|
|
106 |
for (vector<Rcl::Doc>::iterator it = docs.begin(); it != docs.end(); it++) {
|
|
|
107 |
Rcl::Doc &idoc = *it;
|
|
|
108 |
string backend;
|
|
|
109 |
idoc.getmeta(Rcl::Doc::keybcknd, &backend);
|
|
|
110 |
|
|
|
111 |
// This only makes sense for file system files: beagle docs are
|
|
|
112 |
// always up to date because they can't be updated in the cache,
|
|
|
113 |
// only added/removed. Same remark as made inside internfile, we
|
|
|
114 |
// need a generic way to handle backends.
|
|
|
115 |
if (!backend.empty() && backend.compare("FS"))
|
|
|
116 |
continue;
|
|
|
117 |
|
|
|
118 |
// Filesystem document. The url has to be like file://
|
|
|
119 |
if (idoc.url.find(cstr_fileu) != 0) {
|
|
|
120 |
LOGERR("idx::docsToPaths: FS backend and non fs url: [" <<
|
|
|
121 |
idoc.url << "]\n");
|
|
|
122 |
continue;
|
|
|
123 |
}
|
|
|
124 |
paths.push_back(idoc.url.substr(7, string::npos));
|
|
|
125 |
}
|
|
|
126 |
return true;
|
|
|
127 |
}
|
|
|
128 |
|
100 |
}
|
129 |
}
|
101 |
|
130 |
|
102 |
|
131 |
|