cruft at hushmail.com writes: > Hello, > > I'm trying to do some work with the classes in fred as part of > development I'm doing, and I wanted to ask a question about mapfile > metadata. > I'm the right person to ask about the metadata spec, so if I'm in any way unclear about what's going on, make me explain myself better. I can't help quite as much about how fred does this or that, but I'll help as best as I can.
> If you are dealing with a Metadata object, is there a definitive way > to know if it represents a mapfile or not? I'm aware of how to get > document names out of a metadata object, but it's not good enough to > just check if there's more than one document name. there's no real distinction in between mapfile and non-mapfile metadata. It's all covered under the global heading of "control documents". > Also since mapfiles > are often redirects to the default file, it's difficult to tell them > from other redirects. > Some control documents seem to be processed differently than others, for example the DBRs that everyone uses to redirect to the "mapfile" that correlates filenames to CHK (or SSK) keys within a freesite. This isn't quite the case. They're all processed the same: when one requests the URI KEY at keydata[//name1][//name2]..., one should follow the following procedure, with KEY at keydata as the initial URI and name1, name2, ... in a queue. The process involves getting the current URI and checking if it's got a valid control document header (with the version, etc.) If it's not a cdoc and there's still names left in the queue, the requested URI is invalid, or cannot be found or somesuch. If it's a cdoc and it has a DocumentCommand with name matching the first in the queue, that name should be dequeued, and the action inside the DocumentCommand performed (fetching another URI if it's a redirect/DBR, or piecing together a splitfile.) If it's a cdoc and no DocumentCommand matched the first name in the queue, it should be checked for a default action (one with a name of "", or no name specified). In this case, the action is performed without removing anything from the queue. If there's no default and no matching DocumentCommand, the requested URI is invalid, or cannot be found or somesuch. > I know what mapfiles look like in text format, and I'm also not sure > where or how the metadata object stores the corresponding CHK for each > entry. There's a way to get a DocumentCommand object to fetch or put > each of the things in the mapfile, but you can't even get a CHK out of > that. How does one find that CHK through the Mapfile object? > what CHK? DocumentCommands aren't guaranteed to be redirects to CHKs. > I would appreciate it if someone could help me out or point me to the > right place. Some of the javadocs are a bit sparse in places. > > -- Cruft > Thelema -- E-mail: thelema314 at swbell.net Raabu and Piisu GPG 1024D/36352AAB fpr:756D F615 B4F3 BFFC 02C7 84B7 D8D7 6ECE 3635 2AAB _______________________________________________ devl mailing list devl at freenetproject.org http://hawk.freenetproject.org/cgi-bin/mailman/listinfo/devl
