Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The relation struct:
- var struct = module.exports = function(relationType, relationLocator, relationLabel, documentSmallIcon,
- documentLocator, documentLabel, documentType, sORt) {
- var result = {};
- result.relationLocator = relationLocator;
- result.relationType = relationType;
- result.relationLabel = relationLabel;
- result.documentType = documentType;
- result.icon = documentSmallIcon;
- result.locator = documentLocator;
- result.label = documentLabel;
- result.sort = sORt;
- return result;
- };
- Code that creates it from inside a class:
- var struct = require('../util/relnstruct'); // refers to the object above
- var rx = struct(relationType,pivotLocator,relationLabel,
- documentSmallIcon, targetLocator, targetLabel, nodeType,sORt);
- JSON view of Good Struct in a context:
- {
- "relationLocator": "climate_change_TAGTagDocumentRelationTypee164f340-8961-11e4-8eea-5d173b397214",
- "relationType": "TagDocumentRelationType",
- "relationLabel": "TagDocumentRelationType",
- "documentType": "TagNodeType",
- "icon": "/images/tag_sm.png",
- "locator": "climate_change_TAG",
- "label": "Climate Change",
- "sort": "s"
- }
- JSON view of bad (ubuntu) struct in similar context:
- Note: relationLocator has been dropped
- {
- "relationType": "TagDocumentRelationType",
- "relationLabel": "blog_TAGTagDocumentRelationType0b7f2190-8a08-11e4-94bd-db98af817586",
- "documentType": "Blog",
- "icon": "TagDocumentRelationType",
- "locator": "/images/tag_sm.png",
- "label": "blog_TAG",
- "sort": "TagNodeType"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement