cewebs-transformationengine 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/AUTHORS +1 -0
- data/LICENSE.GPL +674 -0
- data/README.md +99 -0
- data/Rakefile +19 -0
- data/cewebs-transformationengine.gemspec +25 -0
- data/index.html +37 -0
- data/lib/cewebs-transformationengine/helpers/site.rb +343 -0
- data/lib/cewebs-transformationengine/implementation.rb +514 -0
- data/lib/cewebs-transformationengine/implementation.xml +14 -0
- data/lib/cewebs-transformationengine/sites.xml +131 -0
- data/menupoints.rng +27 -0
- data/server/data/Default/aman.xml +16 -0
- data/server/data/Default/custom.xml +15 -0
- data/server/data/Default/persons.rng +106 -0
- data/server/data/Default/strings.default.xml +104 -0
- data/server/data/Default/strings.rng +674 -0
- data/server/data/Default/strings.xml +106 -0
- data/server/data/engine.xml +11 -0
- data/server/engine +15 -0
- data/static/icons/large/accessories-calculator.png +0 -0
- data/static/icons/large/accessories-character-map.png +0 -0
- data/static/icons/large/accessories-text-editor.png +0 -0
- data/static/icons/large/address-book-new.png +0 -0
- data/static/icons/large/application-certificate.png +0 -0
- data/static/icons/large/application-magicpoint.png +0 -0
- data/static/icons/large/application-msword.png +0 -0
- data/static/icons/large/application-ogg.png +0 -0
- data/static/icons/large/application-pdf.png +0 -0
- data/static/icons/large/application-postscript.png +0 -0
- data/static/icons/large/application-rtf.png +0 -0
- data/static/icons/large/application-vnd.lotus-1-2-3.png +0 -0
- data/static/icons/large/application-vnd.ms-excel.png +0 -0
- data/static/icons/large/application-vnd.ms-powerpoint.png +0 -0
- data/static/icons/large/application-vnd.oasis.opendocument.graphics-template.png +0 -0
- data/static/icons/large/application-vnd.oasis.opendocument.graphics.png +0 -0
- data/static/icons/large/application-vnd.oasis.opendocument.image.png +0 -0
- data/static/icons/large/application-vnd.oasis.opendocument.presentation-template.png +0 -0
- data/static/icons/large/application-vnd.oasis.opendocument.presentation.png +0 -0
- data/static/icons/large/application-vnd.oasis.opendocument.spreadsheet-template.png +0 -0
- data/static/icons/large/application-vnd.oasis.opendocument.spreadsheet.png +0 -0
- data/static/icons/large/application-vnd.oasis.opendocument.text-template.png +0 -0
- data/static/icons/large/application-vnd.oasis.opendocument.text-web.png +0 -0
- data/static/icons/large/application-vnd.oasis.opendocument.text.png +0 -0
- data/static/icons/large/application-vnd.rn-realmedia-secure.png +0 -0
- data/static/icons/large/application-vnd.rn-realmedia-vbr.png +0 -0
- data/static/icons/large/application-vnd.rn-realmedia.png +0 -0
- data/static/icons/large/application-vnd.stardivision.calc.png +0 -0
- data/static/icons/large/application-vnd.stardivision.impress.png +0 -0
- data/static/icons/large/application-vnd.stardivision.writer.png +0 -0
- data/static/icons/large/application-vnd.sun.xml.calc.png +0 -0
- data/static/icons/large/application-vnd.sun.xml.calc.template.png +0 -0
- data/static/icons/large/application-vnd.sun.xml.draw.png +0 -0
- data/static/icons/large/application-vnd.sun.xml.draw.template.png +0 -0
- data/static/icons/large/application-vnd.sun.xml.impress.png +0 -0
- data/static/icons/large/application-vnd.sun.xml.impress.template.png +0 -0
- data/static/icons/large/application-vnd.sun.xml.writer.png +0 -0
- data/static/icons/large/application-vnd.sun.xml.writer.template.png +0 -0
- data/static/icons/large/application-wordperfect.png +0 -0
- data/static/icons/large/application-x-7z-compressed.png +0 -0
- data/static/icons/large/application-x-abiword.png +0 -0
- data/static/icons/large/application-x-applix-spreadsheet.png +0 -0
- data/static/icons/large/application-x-applix-word.png +0 -0
- data/static/icons/large/application-x-archive.png +0 -0
- data/static/icons/large/application-x-arj.png +0 -0
- data/static/icons/large/application-x-bzip-compressed-tar.png +0 -0
- data/static/icons/large/application-x-bzip.png +0 -0
- data/static/icons/large/application-x-compress.png +0 -0
- data/static/icons/large/application-x-compressed-tar.png +0 -0
- data/static/icons/large/application-x-cpio-compressed.png +0 -0
- data/static/icons/large/application-x-cpio.png +0 -0
- data/static/icons/large/application-x-deb.png +0 -0
- data/static/icons/large/application-x-dvi.png +0 -0
- data/static/icons/large/application-x-executable.png +0 -0
- data/static/icons/large/application-x-font-afm.png +0 -0
- data/static/icons/large/application-x-font-bdf.png +0 -0
- data/static/icons/large/application-x-font-linux-psf.png +0 -0
- data/static/icons/large/application-x-font-pcf.png +0 -0
- data/static/icons/large/application-x-font-sunos-news.png +0 -0
- data/static/icons/large/application-x-font-ttf.png +0 -0
- data/static/icons/large/application-x-gnumeric.png +0 -0
- data/static/icons/large/application-x-gzip.png +0 -0
- data/static/icons/large/application-x-gzpostscript.png +0 -0
- data/static/icons/large/application-x-jar.png +0 -0
- data/static/icons/large/application-x-killustrator.png +0 -0
- data/static/icons/large/application-x-kpresenter.png +0 -0
- data/static/icons/large/application-x-kspread.png +0 -0
- data/static/icons/large/application-x-kword.png +0 -0
- data/static/icons/large/application-x-lha.png +0 -0
- data/static/icons/large/application-x-lhz.png +0 -0
- data/static/icons/large/application-x-ms-dos-executable.png +0 -0
- data/static/icons/large/application-x-perl.png +0 -0
- data/static/icons/large/application-x-python-bytecode.png +0 -0
- data/static/icons/large/application-x-rar.png +0 -0
- data/static/icons/large/application-x-rpm.png +0 -0
- data/static/icons/large/application-x-scribus.png +0 -0
- data/static/icons/large/application-x-shellscript.png +0 -0
- data/static/icons/large/application-x-stuffit.png +0 -0
- data/static/icons/large/application-x-tar.png +0 -0
- data/static/icons/large/application-x-tarz.png +0 -0
- data/static/icons/large/application-x-tex.png +0 -0
- data/static/icons/large/application-xhtml+xml.png +0 -0
- data/static/icons/large/application-zip.png +0 -0
- data/static/icons/large/applications-accessories.png +0 -0
- data/static/icons/large/applications-development.png +0 -0
- data/static/icons/large/applications-games.png +0 -0
- data/static/icons/large/applications-graphics.png +0 -0
- data/static/icons/large/applications-internet.png +0 -0
- data/static/icons/large/applications-multimedia.png +0 -0
- data/static/icons/large/applications-office.png +0 -0
- data/static/icons/large/applications-other.png +0 -0
- data/static/icons/large/applications-system.png +0 -0
- data/static/icons/large/appointment-new.png +0 -0
- data/static/icons/large/audio-card.png +0 -0
- data/static/icons/large/audio-input-microphone.png +0 -0
- data/static/icons/large/audio-volume-high.png +0 -0
- data/static/icons/large/audio-volume-low.png +0 -0
- data/static/icons/large/audio-volume-medium.png +0 -0
- data/static/icons/large/audio-volume-muted.png +0 -0
- data/static/icons/large/audio-x-generic.png +0 -0
- data/static/icons/large/audio.png +0 -0
- data/static/icons/large/battery-caution.png +0 -0
- data/static/icons/large/battery.png +0 -0
- data/static/icons/large/bookmark-new.png +0 -0
- data/static/icons/large/camera-photo.png +0 -0
- data/static/icons/large/camera-video.png +0 -0
- data/static/icons/large/computer.png +0 -0
- data/static/icons/large/contact-new.png +0 -0
- data/static/icons/large/dialog-error.png +0 -0
- data/static/icons/large/dialog-information.png +0 -0
- data/static/icons/large/dialog-warning.png +0 -0
- data/static/icons/large/document-new.png +0 -0
- data/static/icons/large/document-open.png +0 -0
- data/static/icons/large/document-print-preview.png +0 -0
- data/static/icons/large/document-print.png +0 -0
- data/static/icons/large/document-properties.png +0 -0
- data/static/icons/large/document-save-as.png +0 -0
- data/static/icons/large/document-save.png +0 -0
- data/static/icons/large/drive-harddisk.png +0 -0
- data/static/icons/large/drive-optical.png +0 -0
- data/static/icons/large/drive-removable-media.png +0 -0
- data/static/icons/large/edit-clear.png +0 -0
- data/static/icons/large/edit-copy.png +0 -0
- data/static/icons/large/edit-cut.png +0 -0
- data/static/icons/large/edit-delete.png +0 -0
- data/static/icons/large/edit-find-replace.png +0 -0
- data/static/icons/large/edit-find.png +0 -0
- data/static/icons/large/edit-paste.png +0 -0
- data/static/icons/large/edit-redo.png +0 -0
- data/static/icons/large/edit-select-all.png +0 -0
- data/static/icons/large/edit-undo.png +0 -0
- data/static/icons/large/emblem-favorite.png +0 -0
- data/static/icons/large/emblem-important.png +0 -0
- data/static/icons/large/emblem-photos.png +0 -0
- data/static/icons/large/emblem-readonly.png +0 -0
- data/static/icons/large/emblem-symbolic-link.png +0 -0
- data/static/icons/large/emblem-system.png +0 -0
- data/static/icons/large/emblem-unreadable.png +0 -0
- data/static/icons/large/face-angel.png +0 -0
- data/static/icons/large/face-crying.png +0 -0
- data/static/icons/large/face-devil-grin.png +0 -0
- data/static/icons/large/face-glasses.png +0 -0
- data/static/icons/large/face-grin.png +0 -0
- data/static/icons/large/face-kiss.png +0 -0
- data/static/icons/large/face-monkey.png +0 -0
- data/static/icons/large/face-plain.png +0 -0
- data/static/icons/large/face-sad.png +0 -0
- data/static/icons/large/face-smile-big.png +0 -0
- data/static/icons/large/face-smile.png +0 -0
- data/static/icons/large/face-surprise.png +0 -0
- data/static/icons/large/face-wink.png +0 -0
- data/static/icons/large/folder-drag-accept.png +0 -0
- data/static/icons/large/folder-new.png +0 -0
- data/static/icons/large/folder-open.png +0 -0
- data/static/icons/large/folder-remote.png +0 -0
- data/static/icons/large/folder-saved-search.png +0 -0
- data/static/icons/large/folder-visiting.png +0 -0
- data/static/icons/large/folder.png +0 -0
- data/static/icons/large/font-x-generic.png +0 -0
- data/static/icons/large/format-indent-less.png +0 -0
- data/static/icons/large/format-indent-more.png +0 -0
- data/static/icons/large/format-justify-center.png +0 -0
- data/static/icons/large/format-justify-fill.png +0 -0
- data/static/icons/large/format-justify-left.png +0 -0
- data/static/icons/large/format-justify-right.png +0 -0
- data/static/icons/large/format-text-bold.png +0 -0
- data/static/icons/large/format-text-italic.png +0 -0
- data/static/icons/large/format-text-strikethrough.png +0 -0
- data/static/icons/large/format-text-underline.png +0 -0
- data/static/icons/large/go-bottom.png +0 -0
- data/static/icons/large/go-down.png +0 -0
- data/static/icons/large/go-first.png +0 -0
- data/static/icons/large/go-home.png +0 -0
- data/static/icons/large/go-jump.png +0 -0
- data/static/icons/large/go-last.png +0 -0
- data/static/icons/large/go-next.png +0 -0
- data/static/icons/large/go-previous.png +0 -0
- data/static/icons/large/go-top.png +0 -0
- data/static/icons/large/go-up.png +0 -0
- data/static/icons/large/help-browser.png +0 -0
- data/static/icons/large/image-loading.png +0 -0
- data/static/icons/large/image-missing.png +0 -0
- data/static/icons/large/image-x-generic.png +0 -0
- data/static/icons/large/input-gaming.png +0 -0
- data/static/icons/large/input-keyboard.png +0 -0
- data/static/icons/large/input-mouse.png +0 -0
- data/static/icons/large/internet-group-chat.png +0 -0
- data/static/icons/large/internet-mail.png +0 -0
- data/static/icons/large/internet-news-reader.png +0 -0
- data/static/icons/large/internet-web-browser.png +0 -0
- data/static/icons/large/list-add.png +0 -0
- data/static/icons/large/list-remove.png +0 -0
- data/static/icons/large/mail-attachment.png +0 -0
- data/static/icons/large/mail-forward.png +0 -0
- data/static/icons/large/mail-mark-junk.png +0 -0
- data/static/icons/large/mail-mark-not-junk.png +0 -0
- data/static/icons/large/mail-message-new.png +0 -0
- data/static/icons/large/mail-reply-all.png +0 -0
- data/static/icons/large/mail-reply-sender.png +0 -0
- data/static/icons/large/mail-send-receive.png +0 -0
- data/static/icons/large/media-eject.png +0 -0
- data/static/icons/large/media-flash.png +0 -0
- data/static/icons/large/media-floppy.png +0 -0
- data/static/icons/large/media-optical.png +0 -0
- data/static/icons/large/media-playback-pause.png +0 -0
- data/static/icons/large/media-playback-start.png +0 -0
- data/static/icons/large/media-playback-stop.png +0 -0
- data/static/icons/large/media-record.png +0 -0
- data/static/icons/large/media-seek-backward.png +0 -0
- data/static/icons/large/media-seek-forward.png +0 -0
- data/static/icons/large/media-skip-backward.png +0 -0
- data/static/icons/large/media-skip-forward.png +0 -0
- data/static/icons/large/mime-application-x-php.png +0 -0
- data/static/icons/large/mime-application-x-shockwave-flash.png +0 -0
- data/static/icons/large/mime-image.png +0 -0
- data/static/icons/large/multimedia-player.png +0 -0
- data/static/icons/large/network-error.png +0 -0
- data/static/icons/large/network-idle.png +0 -0
- data/static/icons/large/network-offline.png +0 -0
- data/static/icons/large/network-receive.png +0 -0
- data/static/icons/large/network-server.png +0 -0
- data/static/icons/large/network-transmit-receive.png +0 -0
- data/static/icons/large/network-transmit.png +0 -0
- data/static/icons/large/network-wired.png +0 -0
- data/static/icons/large/network-wireless-encrypted.png +0 -0
- data/static/icons/large/network-wireless.png +0 -0
- data/static/icons/large/network-workgroup.png +0 -0
- data/static/icons/large/office-calendar.png +0 -0
- data/static/icons/large/package-x-generic.png +0 -0
- data/static/icons/large/preferences-desktop-accessibility.png +0 -0
- data/static/icons/large/preferences-desktop-assistive-technology.png +0 -0
- data/static/icons/large/preferences-desktop-font.png +0 -0
- data/static/icons/large/preferences-desktop-keyboard-shortcuts.png +0 -0
- data/static/icons/large/preferences-desktop-locale.png +0 -0
- data/static/icons/large/preferences-desktop-peripherals.png +0 -0
- data/static/icons/large/preferences-desktop-remote-desktop.png +0 -0
- data/static/icons/large/preferences-desktop-screensaver.png +0 -0
- data/static/icons/large/preferences-desktop-sound.png +0 -0
- data/static/icons/large/preferences-desktop-theme.png +0 -0
- data/static/icons/large/preferences-desktop-wallpaper.png +0 -0
- data/static/icons/large/preferences-desktop.png +0 -0
- data/static/icons/large/preferences-system-network-proxy.png +0 -0
- data/static/icons/large/preferences-system-session.png +0 -0
- data/static/icons/large/preferences-system-windows.png +0 -0
- data/static/icons/large/preferences-system.png +0 -0
- data/static/icons/large/printer-error.png +0 -0
- data/static/icons/large/printer.png +0 -0
- data/static/icons/large/process-stop.png +0 -0
- data/static/icons/large/process-working.png +0 -0
- data/static/icons/large/start-here.png +0 -0
- data/static/icons/large/system-file-manager.png +0 -0
- data/static/icons/large/system-installer.png +0 -0
- data/static/icons/large/system-lock-screen.png +0 -0
- data/static/icons/large/system-log-out.png +0 -0
- data/static/icons/large/system-search.png +0 -0
- data/static/icons/large/system-shutdown.png +0 -0
- data/static/icons/large/system-software-update.png +0 -0
- data/static/icons/large/system-users.png +0 -0
- data/static/icons/large/tab-new.png +0 -0
- data/static/icons/large/text-html.png +0 -0
- data/static/icons/large/text-vnd.wap.wml.png +0 -0
- data/static/icons/large/text-x-csh.png +0 -0
- data/static/icons/large/text-x-generic-template.png +0 -0
- data/static/icons/large/text-x-generic.png +0 -0
- data/static/icons/large/text-x-python.png +0 -0
- data/static/icons/large/text-x-script.png +0 -0
- data/static/icons/large/text-x-sh.png +0 -0
- data/static/icons/large/text-x-vcalendar.png +0 -0
- data/static/icons/large/text-x-vcard.png +0 -0
- data/static/icons/large/text-x-zsh.png +0 -0
- data/static/icons/large/text.png +0 -0
- data/static/icons/large/user-desktop.png +0 -0
- data/static/icons/large/user-home.png +0 -0
- data/static/icons/large/user-trash-full.png +0 -0
- data/static/icons/large/user-trash.png +0 -0
- data/static/icons/large/utilities-system-monitor.png +0 -0
- data/static/icons/large/utilities-terminal.png +0 -0
- data/static/icons/large/video-display.png +0 -0
- data/static/icons/large/video-x-generic.png +0 -0
- data/static/icons/large/video.png +0 -0
- data/static/icons/large/view-fullscreen.png +0 -0
- data/static/icons/large/view-refresh.png +0 -0
- data/static/icons/large/weather-clear-night.png +0 -0
- data/static/icons/large/weather-clear.png +0 -0
- data/static/icons/large/weather-few-clouds-night.png +0 -0
- data/static/icons/large/weather-few-clouds.png +0 -0
- data/static/icons/large/weather-overcast.png +0 -0
- data/static/icons/large/weather-severe-alert.png +0 -0
- data/static/icons/large/weather-showers-scattered.png +0 -0
- data/static/icons/large/weather-showers.png +0 -0
- data/static/icons/large/weather-snow.png +0 -0
- data/static/icons/large/weather-storm.png +0 -0
- data/static/icons/large/window-new.png +0 -0
- data/static/icons/large/x-font-afm.png +0 -0
- data/static/icons/large/x-office-address-book.png +0 -0
- data/static/icons/large/x-office-calendar.png +0 -0
- data/static/icons/large/x-office-document-template.png +0 -0
- data/static/icons/large/x-office-document.png +0 -0
- data/static/icons/large/x-office-drawing-template.png +0 -0
- data/static/icons/large/x-office-drawing.png +0 -0
- data/static/icons/large/x-office-presentation-template.png +0 -0
- data/static/icons/large/x-office-presentation.png +0 -0
- data/static/icons/large/x-office-spreadsheet-template.png +0 -0
- data/static/icons/large/x-office-spreadsheet.png +0 -0
- data/static/icons/small/accessories-calculator.png +0 -0
- data/static/icons/small/accessories-character-map.png +0 -0
- data/static/icons/small/accessories-text-editor.png +0 -0
- data/static/icons/small/address-book-new.png +0 -0
- data/static/icons/small/application-certificate.png +0 -0
- data/static/icons/small/application-magicpoint.png +0 -0
- data/static/icons/small/application-msword.png +0 -0
- data/static/icons/small/application-ogg.png +0 -0
- data/static/icons/small/application-pdf.png +0 -0
- data/static/icons/small/application-postscript.png +0 -0
- data/static/icons/small/application-rar.png +0 -0
- data/static/icons/small/application-rtf.png +0 -0
- data/static/icons/small/application-vnd.lotus-1-2-3.png +0 -0
- data/static/icons/small/application-vnd.ms-excel.png +0 -0
- data/static/icons/small/application-vnd.ms-powerpoint.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.chart.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.formula.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.graphics-template.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.graphics.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.image.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.presentation-template.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.presentation.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.spreadsheet-template.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.spreadsheet.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.text-template.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.text-web.png +0 -0
- data/static/icons/small/application-vnd.oasis.opendocument.text.png +0 -0
- data/static/icons/small/application-vnd.rn-realmedia-secure.png +0 -0
- data/static/icons/small/application-vnd.rn-realmedia-vbr.png +0 -0
- data/static/icons/small/application-vnd.rn-realmedia.png +0 -0
- data/static/icons/small/application-vnd.stardivision.calc.png +0 -0
- data/static/icons/small/application-vnd.stardivision.impress.png +0 -0
- data/static/icons/small/application-vnd.stardivision.writer.png +0 -0
- data/static/icons/small/application-vnd.sun.xml.calc.png +0 -0
- data/static/icons/small/application-vnd.sun.xml.calc.template.png +0 -0
- data/static/icons/small/application-vnd.sun.xml.draw.png +0 -0
- data/static/icons/small/application-vnd.sun.xml.draw.template.png +0 -0
- data/static/icons/small/application-vnd.sun.xml.impress.png +0 -0
- data/static/icons/small/application-vnd.sun.xml.impress.template.png +0 -0
- data/static/icons/small/application-vnd.sun.xml.writer.png +0 -0
- data/static/icons/small/application-vnd.sun.xml.writer.template.png +0 -0
- data/static/icons/small/application-wordperfect.png +0 -0
- data/static/icons/small/application-x-7z-compressed.png +0 -0
- data/static/icons/small/application-x-abiword.png +0 -0
- data/static/icons/small/application-x-applix-spreadsheet.png +0 -0
- data/static/icons/small/application-x-applix-word.png +0 -0
- data/static/icons/small/application-x-archive.png +0 -0
- data/static/icons/small/application-x-arj.png +0 -0
- data/static/icons/small/application-x-bzip-compressed-tar.png +0 -0
- data/static/icons/small/application-x-bzip.png +0 -0
- data/static/icons/small/application-x-chm.png +0 -0
- data/static/icons/small/application-x-compress.png +0 -0
- data/static/icons/small/application-x-compressed-tar.png +0 -0
- data/static/icons/small/application-x-cpio-compressed.png +0 -0
- data/static/icons/small/application-x-cpio.png +0 -0
- data/static/icons/small/application-x-deb.png +0 -0
- data/static/icons/small/application-x-debian-package.png +0 -0
- data/static/icons/small/application-x-dvi.png +0 -0
- data/static/icons/small/application-x-executable.png +0 -0
- data/static/icons/small/application-x-font-afm.png +0 -0
- data/static/icons/small/application-x-font-bdf.png +0 -0
- data/static/icons/small/application-x-font-linux-psf.png +0 -0
- data/static/icons/small/application-x-font-pcf.png +0 -0
- data/static/icons/small/application-x-font-sunos-news.png +0 -0
- data/static/icons/small/application-x-font-ttf.png +0 -0
- data/static/icons/small/application-x-gnumeric.png +0 -0
- data/static/icons/small/application-x-gtar.png +0 -0
- data/static/icons/small/application-x-gzip.png +0 -0
- data/static/icons/small/application-x-gzpostscript.png +0 -0
- data/static/icons/small/application-x-httpd-php.png +0 -0
- data/static/icons/small/application-x-iso9660-image.png +0 -0
- data/static/icons/small/application-x-jar.png +0 -0
- data/static/icons/small/application-x-javascript.png +0 -0
- data/static/icons/small/application-x-killustrator.png +0 -0
- data/static/icons/small/application-x-kpresenter.png +0 -0
- data/static/icons/small/application-x-kspread.png +0 -0
- data/static/icons/small/application-x-kword.png +0 -0
- data/static/icons/small/application-x-lha.png +0 -0
- data/static/icons/small/application-x-lhz.png +0 -0
- data/static/icons/small/application-x-ms-dos-executable.png +0 -0
- data/static/icons/small/application-x-perl.png +0 -0
- data/static/icons/small/application-x-python-bytecode.png +0 -0
- data/static/icons/small/application-x-rar.png +0 -0
- data/static/icons/small/application-x-redhat-package-manager.png +0 -0
- data/static/icons/small/application-x-rpm.png +0 -0
- data/static/icons/small/application-x-scribus.png +0 -0
- data/static/icons/small/application-x-shellscript.png +0 -0
- data/static/icons/small/application-x-shockwave-flash.png +0 -0
- data/static/icons/small/application-x-stuffit.png +0 -0
- data/static/icons/small/application-x-tar.png +0 -0
- data/static/icons/small/application-x-tarz.png +0 -0
- data/static/icons/small/application-x-tex.png +0 -0
- data/static/icons/small/application-x-xpinstall.png +0 -0
- data/static/icons/small/application-xhtml+xml.png +0 -0
- data/static/icons/small/application-xml.png +0 -0
- data/static/icons/small/application-zip.png +0 -0
- data/static/icons/small/applications-accessories.png +0 -0
- data/static/icons/small/applications-development.png +0 -0
- data/static/icons/small/applications-games.png +0 -0
- data/static/icons/small/applications-graphics.png +0 -0
- data/static/icons/small/applications-internet.png +0 -0
- data/static/icons/small/applications-multimedia.png +0 -0
- data/static/icons/small/applications-office.png +0 -0
- data/static/icons/small/applications-other.png +0 -0
- data/static/icons/small/applications-system.png +0 -0
- data/static/icons/small/appointment-new.png +0 -0
- data/static/icons/small/audio-card.png +0 -0
- data/static/icons/small/audio-input-microphone.png +0 -0
- data/static/icons/small/audio-mpeg.png +0 -0
- data/static/icons/small/audio-volume-high.png +0 -0
- data/static/icons/small/audio-volume-low.png +0 -0
- data/static/icons/small/audio-volume-medium.png +0 -0
- data/static/icons/small/audio-volume-muted.png +0 -0
- data/static/icons/small/audio-x-aiff.png +0 -0
- data/static/icons/small/audio-x-generic.png +0 -0
- data/static/icons/small/audio-x-ms-wma.png +0 -0
- data/static/icons/small/audio-x-pn-realaudio.png +0 -0
- data/static/icons/small/audio-x-wav.png +0 -0
- data/static/icons/small/audio.png +0 -0
- data/static/icons/small/battery-caution.png +0 -0
- data/static/icons/small/battery.png +0 -0
- data/static/icons/small/bookmark-new.png +0 -0
- data/static/icons/small/camera-photo.png +0 -0
- data/static/icons/small/camera-video.png +0 -0
- data/static/icons/small/chemical-x-mopac-input.png +0 -0
- data/static/icons/small/computer.png +0 -0
- data/static/icons/small/contact-new.png +0 -0
- data/static/icons/small/dialog-error.png +0 -0
- data/static/icons/small/dialog-information.png +0 -0
- data/static/icons/small/dialog-warning.png +0 -0
- data/static/icons/small/document-new.png +0 -0
- data/static/icons/small/document-open.png +0 -0
- data/static/icons/small/document-print-preview.png +0 -0
- data/static/icons/small/document-print.png +0 -0
- data/static/icons/small/document-properties.png +0 -0
- data/static/icons/small/document-save-as.png +0 -0
- data/static/icons/small/document-save.png +0 -0
- data/static/icons/small/drive-harddisk.png +0 -0
- data/static/icons/small/drive-optical.png +0 -0
- data/static/icons/small/drive-removable-media.png +0 -0
- data/static/icons/small/edit-clear.png +0 -0
- data/static/icons/small/edit-copy.png +0 -0
- data/static/icons/small/edit-cut.png +0 -0
- data/static/icons/small/edit-delete.png +0 -0
- data/static/icons/small/edit-find-replace.png +0 -0
- data/static/icons/small/edit-find.png +0 -0
- data/static/icons/small/edit-paste.png +0 -0
- data/static/icons/small/edit-redo.png +0 -0
- data/static/icons/small/edit-select-all.png +0 -0
- data/static/icons/small/edit-undo.png +0 -0
- data/static/icons/small/emblem-favorite.png +0 -0
- data/static/icons/small/emblem-important.png +0 -0
- data/static/icons/small/emblem-photos.png +0 -0
- data/static/icons/small/emblem-readonly.png +0 -0
- data/static/icons/small/emblem-symbolic-link.png +0 -0
- data/static/icons/small/emblem-system.png +0 -0
- data/static/icons/small/emblem-unreadable.png +0 -0
- data/static/icons/small/face-angel.png +0 -0
- data/static/icons/small/face-crying.png +0 -0
- data/static/icons/small/face-devil-grin.png +0 -0
- data/static/icons/small/face-glasses.png +0 -0
- data/static/icons/small/face-grin.png +0 -0
- data/static/icons/small/face-kiss.png +0 -0
- data/static/icons/small/face-monkey.png +0 -0
- data/static/icons/small/face-plain.png +0 -0
- data/static/icons/small/face-sad.png +0 -0
- data/static/icons/small/face-smile-big.png +0 -0
- data/static/icons/small/face-smile.png +0 -0
- data/static/icons/small/face-surprise.png +0 -0
- data/static/icons/small/face-wink.png +0 -0
- data/static/icons/small/folder-drag-accept.png +0 -0
- data/static/icons/small/folder-new.png +0 -0
- data/static/icons/small/folder-open.png +0 -0
- data/static/icons/small/folder-remote.png +0 -0
- data/static/icons/small/folder-saved-search.png +0 -0
- data/static/icons/small/folder-visiting.png +0 -0
- data/static/icons/small/folder.png +0 -0
- data/static/icons/small/font-x-generic.png +0 -0
- data/static/icons/small/format-indent-less.png +0 -0
- data/static/icons/small/format-indent-more.png +0 -0
- data/static/icons/small/format-justify-center.png +0 -0
- data/static/icons/small/format-justify-fill.png +0 -0
- data/static/icons/small/format-justify-left.png +0 -0
- data/static/icons/small/format-justify-right.png +0 -0
- data/static/icons/small/format-text-bold.png +0 -0
- data/static/icons/small/format-text-italic.png +0 -0
- data/static/icons/small/format-text-strikethrough.png +0 -0
- data/static/icons/small/format-text-underline.png +0 -0
- data/static/icons/small/go-bottom.png +0 -0
- data/static/icons/small/go-down.png +0 -0
- data/static/icons/small/go-first.png +0 -0
- data/static/icons/small/go-home.png +0 -0
- data/static/icons/small/go-jump.png +0 -0
- data/static/icons/small/go-last.png +0 -0
- data/static/icons/small/go-next.png +0 -0
- data/static/icons/small/go-previous.png +0 -0
- data/static/icons/small/go-top.png +0 -0
- data/static/icons/small/go-up.png +0 -0
- data/static/icons/small/help-browser.png +0 -0
- data/static/icons/small/image-gif.png +0 -0
- data/static/icons/small/image-jpeg.png +0 -0
- data/static/icons/small/image-loading.png +0 -0
- data/static/icons/small/image-missing.png +0 -0
- data/static/icons/small/image-png.png +0 -0
- data/static/icons/small/image-x-generic.png +0 -0
- data/static/icons/small/input-gaming.png +0 -0
- data/static/icons/small/input-keyboard.png +0 -0
- data/static/icons/small/input-mouse.png +0 -0
- data/static/icons/small/internet-group-chat.png +0 -0
- data/static/icons/small/internet-mail.png +0 -0
- data/static/icons/small/internet-news-reader.png +0 -0
- data/static/icons/small/internet-web-browser.png +0 -0
- data/static/icons/small/list-add.png +0 -0
- data/static/icons/small/list-remove.png +0 -0
- data/static/icons/small/locked.png +0 -0
- data/static/icons/small/mail-attachment.png +0 -0
- data/static/icons/small/mail-forward.png +0 -0
- data/static/icons/small/mail-mark-junk.png +0 -0
- data/static/icons/small/mail-mark-not-junk.png +0 -0
- data/static/icons/small/mail-message-new.png +0 -0
- data/static/icons/small/mail-reply-all.png +0 -0
- data/static/icons/small/mail-reply-sender.png +0 -0
- data/static/icons/small/mail-send-receive.png +0 -0
- data/static/icons/small/media-eject.png +0 -0
- data/static/icons/small/media-flash.png +0 -0
- data/static/icons/small/media-floppy.png +0 -0
- data/static/icons/small/media-optical.png +0 -0
- data/static/icons/small/media-playback-pause.png +0 -0
- data/static/icons/small/media-playback-start.png +0 -0
- data/static/icons/small/media-playback-stop.png +0 -0
- data/static/icons/small/media-record.png +0 -0
- data/static/icons/small/media-seek-backward.png +0 -0
- data/static/icons/small/media-seek-forward.png +0 -0
- data/static/icons/small/media-skip-backward.png +0 -0
- data/static/icons/small/media-skip-forward.png +0 -0
- data/static/icons/small/multimedia-player.png +0 -0
- data/static/icons/small/network-error.png +0 -0
- data/static/icons/small/network-idle.png +0 -0
- data/static/icons/small/network-offline.png +0 -0
- data/static/icons/small/network-receive.png +0 -0
- data/static/icons/small/network-server.png +0 -0
- data/static/icons/small/network-transmit-receive.png +0 -0
- data/static/icons/small/network-transmit.png +0 -0
- data/static/icons/small/network-wired.png +0 -0
- data/static/icons/small/network-wireless-encrypted.png +0 -0
- data/static/icons/small/network-wireless.png +0 -0
- data/static/icons/small/network-workgroup.png +0 -0
- data/static/icons/small/office-calendar.png +0 -0
- data/static/icons/small/package-x-generic.png +0 -0
- data/static/icons/small/preferences-desktop-accessibility.png +0 -0
- data/static/icons/small/preferences-desktop-assistive-technology.png +0 -0
- data/static/icons/small/preferences-desktop-font.png +0 -0
- data/static/icons/small/preferences-desktop-keyboard-shortcuts.png +0 -0
- data/static/icons/small/preferences-desktop-locale.png +0 -0
- data/static/icons/small/preferences-desktop-peripherals.png +0 -0
- data/static/icons/small/preferences-desktop-remote-desktop.png +0 -0
- data/static/icons/small/preferences-desktop-screensaver.png +0 -0
- data/static/icons/small/preferences-desktop-sound.png +0 -0
- data/static/icons/small/preferences-desktop-theme.png +0 -0
- data/static/icons/small/preferences-desktop-wallpaper.png +0 -0
- data/static/icons/small/preferences-desktop.png +0 -0
- data/static/icons/small/preferences-system-network-proxy.png +0 -0
- data/static/icons/small/preferences-system-session.png +0 -0
- data/static/icons/small/preferences-system-windows.png +0 -0
- data/static/icons/small/preferences-system.png +0 -0
- data/static/icons/small/printer-error.png +0 -0
- data/static/icons/small/printer.png +0 -0
- data/static/icons/small/process-stop.png +0 -0
- data/static/icons/small/process-working.png +0 -0
- data/static/icons/small/start-here.png +0 -0
- data/static/icons/small/system-file-manager.png +0 -0
- data/static/icons/small/system-installer.png +0 -0
- data/static/icons/small/system-lock-screen.png +0 -0
- data/static/icons/small/system-log-out.png +0 -0
- data/static/icons/small/system-search.png +0 -0
- data/static/icons/small/system-shutdown.png +0 -0
- data/static/icons/small/system-software-update.png +0 -0
- data/static/icons/small/system-users.png +0 -0
- data/static/icons/small/tab-new.png +0 -0
- data/static/icons/small/text-css.png +0 -0
- data/static/icons/small/text-html.png +0 -0
- data/static/icons/small/text-plain.png +0 -0
- data/static/icons/small/text-vnd.wap.wml.png +0 -0
- data/static/icons/small/text-x-c++src.png +0 -0
- data/static/icons/small/text-x-chdr.png +0 -0
- data/static/icons/small/text-x-cppsrc.png +0 -0
- data/static/icons/small/text-x-csh.png +0 -0
- data/static/icons/small/text-x-csrc.png +0 -0
- data/static/icons/small/text-x-generic-template.png +0 -0
- data/static/icons/small/text-x-generic.png +0 -0
- data/static/icons/small/text-x-java.png +0 -0
- data/static/icons/small/text-x-perl.png +0 -0
- data/static/icons/small/text-x-python.png +0 -0
- data/static/icons/small/text-x-script.png +0 -0
- data/static/icons/small/text-x-sh.png +0 -0
- data/static/icons/small/text-x-tex.png +0 -0
- data/static/icons/small/text-x-vcalendar.png +0 -0
- data/static/icons/small/text-x-vcard.png +0 -0
- data/static/icons/small/text-x-zsh.png +0 -0
- data/static/icons/small/text.png +0 -0
- data/static/icons/small/unlocked.png +0 -0
- data/static/icons/small/user-desktop.png +0 -0
- data/static/icons/small/user-home.png +0 -0
- data/static/icons/small/user-trash-full.png +0 -0
- data/static/icons/small/user-trash.png +0 -0
- data/static/icons/small/utilities-system-monitor.png +0 -0
- data/static/icons/small/utilities-terminal.png +0 -0
- data/static/icons/small/video-display.png +0 -0
- data/static/icons/small/video-mpeg.png +0 -0
- data/static/icons/small/video-quicktime.png +0 -0
- data/static/icons/small/video-x-generic.png +0 -0
- data/static/icons/small/video-x-ms-wmv.png +0 -0
- data/static/icons/small/video.png +0 -0
- data/static/icons/small/view-fullscreen.png +0 -0
- data/static/icons/small/view-refresh.png +0 -0
- data/static/icons/small/weather-clear-night.png +0 -0
- data/static/icons/small/weather-clear.png +0 -0
- data/static/icons/small/weather-few-clouds-night.png +0 -0
- data/static/icons/small/weather-few-clouds.png +0 -0
- data/static/icons/small/weather-overcast.png +0 -0
- data/static/icons/small/weather-severe-alert.png +0 -0
- data/static/icons/small/weather-showers-scattered.png +0 -0
- data/static/icons/small/weather-showers.png +0 -0
- data/static/icons/small/weather-snow.png +0 -0
- data/static/icons/small/weather-storm.png +0 -0
- data/static/icons/small/window-new.png +0 -0
- data/static/icons/small/x-font-afm.png +0 -0
- data/static/icons/small/x-office-address-book.png +0 -0
- data/static/icons/small/x-office-calendar.png +0 -0
- data/static/icons/small/x-office-document-template.png +0 -0
- data/static/icons/small/x-office-document.png +0 -0
- data/static/icons/small/x-office-drawing-template.png +0 -0
- data/static/icons/small/x-office-drawing.png +0 -0
- data/static/icons/small/x-office-presentation-template.png +0 -0
- data/static/icons/small/x-office-presentation.png +0 -0
- data/static/icons/small/x-office-spreadsheet-template.png +0 -0
- data/static/icons/small/x-office-spreadsheet.png +0 -0
- data/static/icons/tiny/blank.png +0 -0
- data/static/icons/tiny/go-down.png +0 -0
- data/static/icons/tiny/go-down.svg +199 -0
- data/static/icons/tiny/go-up.png +0 -0
- data/static/icons/tiny/go-up.svg +195 -0
- data/static/icons/tiny/sort-ascending.png +0 -0
- data/static/icons/tiny/sort-ascending.svg +308 -0
- data/static/icons/tiny/sort-descending.png +0 -0
- data/static/icons/tiny/sort-descending.svg +308 -0
- data/static/js/administration.js +306 -0
- data/static/js/engine.js +414 -0
- data/static/js/jquery/base64.js +133 -0
- data/static/js/jquery/jquery-ui.min.js +6 -0
- data/static/js/jquery/jquery.min.js +2 -0
- data/static/js/jquery/printf.js +155 -0
- data/static/styles/AdwaitaSans-Latin.woff2 +0 -0
- data/static/styles/AdwaitaSans-Regular.ttf +0 -0
- data/static/styles/AdwaitaSans-Regular.ttf.License +96 -0
- data/static/styles/CEWebS.ico +0 -0
- data/static/styles/content.css +757 -0
- data/static/styles/fullplain.css +6 -0
- data/static/styles/jquery-ui/custom.css +75 -0
- data/static/styles/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/static/styles/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/static/styles/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/static/styles/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/static/styles/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/static/styles/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/static/styles/jquery-ui/images/ui-icons_222222_256x240.png +0 -0
- data/static/styles/jquery-ui/images/ui-icons_2e83ff_256x240.png +0 -0
- data/static/styles/jquery-ui/images/ui-icons_454545_256x240.png +0 -0
- data/static/styles/jquery-ui/images/ui-icons_888888_256x240.png +0 -0
- data/static/styles/jquery-ui/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/static/styles/jquery-ui/jquery-ui.css +1312 -0
- data/static/styles/plain.css +246 -0
- data/static/styles/plain_ohne.css +6 -0
- data/static/styles/print.css +28 -0
- data/static/styles/uni.compact.css +262 -0
- data/static/styles/uni.css +299 -0
- data/static/styles/uni_big.css +5 -0
- data/tools/cewebs-transformationengine +98 -0
- metadata +785 -0
data/README.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# CEWebS Transformation Engine
|
|
2
|
+
|
|
3
|
+
Websites that consist of services: a static page that loads everything with Ajax, and the engine that asks the
|
|
4
|
+
services. This is also the description of how all parts of CEWebS work together:
|
|
5
|
+
|
|
6
|
+
| Gem | Port | What |
|
|
7
|
+
|-------------------------------|------|-------------------------------------------------------------------|
|
|
8
|
+
| `cewebs-transformationengine` | 9020 | websites |
|
|
9
|
+
| `cewebs-aman` | 9021 | subscribing to services, configuration of services and the engine |
|
|
10
|
+
| `cewebs-rman` | 9022 | reports of services, uses the data of the AMan |
|
|
11
|
+
| `cewebs-didaktiki` | 9023 | wiki |
|
|
12
|
+
| `cewebs-servicesbase` | | contracts (riddl) and code that is used by all services |
|
|
13
|
+
| `redel` | | basic parser and HTML |
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
In the directory that contains all gems:
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
for d in redel cewebs-servicesbase cewebs-aman cewebs-rman cewebs-didaktiki cewebs-transformationengine; do
|
|
21
|
+
(cd $d && rake install)
|
|
22
|
+
done
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Every gem has one tool of the same name, that scaffolds a server with `new`. In the directory where the servers
|
|
26
|
+
should be:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
cewebs-aman new aman
|
|
30
|
+
cewebs-rman new rman aman
|
|
31
|
+
cewebs-didaktiki new didaktiki
|
|
32
|
+
cewebs-transformationengine new engine
|
|
33
|
+
cewebs-aman service aman didaktiki # the AMan offers the wiki
|
|
34
|
+
|
|
35
|
+
aman/aman start
|
|
36
|
+
rman/rman start
|
|
37
|
+
didaktiki/didaktiki start
|
|
38
|
+
engine/engine start
|
|
39
|
+
cewebs-transformationengine site engine /var/www/CEWebS $(cewebs-aman addkey aman)
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`new` for a directory that already exists updates everything except its data and configuration. Port and other
|
|
43
|
+
options can be changed in a file next to the server, e.g. `engine/engine.conf` with `:port: 9120`.
|
|
44
|
+
|
|
45
|
+
## Websites
|
|
46
|
+
|
|
47
|
+
`cewebs-transformationengine site` creates a website and prints the password of its user `admin`.
|
|
48
|
+
`cewebs-transformationengine passwd engine /var/www/CEWebS admin` sets a new one, with `-r` it is removed. The
|
|
49
|
+
website consists of
|
|
50
|
+
|
|
51
|
+
* `index.html`, a link to the one of the engine. Replace it with a copy to change it for one website,
|
|
52
|
+
* `static` (icons, scripts, stylesheets), also a link,
|
|
53
|
+
* `CEWebSData` (configuration, users, sessions, cache), only for the engine.
|
|
54
|
+
|
|
55
|
+
Websites can be anywhere in the root of the web server (`sites` in `engine/data/engine.xml`), also inside of
|
|
56
|
+
each other. They can be moved, AMan is told when the website is opened for the first time. Do not copy them: a
|
|
57
|
+
copy uses the same services.
|
|
58
|
+
|
|
59
|
+
The web server serves the websites. Everything else only listens on localhost. One engine is enough for all
|
|
60
|
+
websites:
|
|
61
|
+
|
|
62
|
+
```nginx
|
|
63
|
+
location ^~ /CEWebSEngine/ {
|
|
64
|
+
proxy_read_timeout 120s;
|
|
65
|
+
proxy_set_header X-Forwarded-Proto $scheme;
|
|
66
|
+
proxy_set_header X-Forwarded-Host $host;
|
|
67
|
+
proxy_set_header X-Forwarded-Prefix /CEWebSEngine/;
|
|
68
|
+
proxy_pass http://127.0.0.1:9020/;
|
|
69
|
+
}
|
|
70
|
+
location ~ /CEWebSData(/|$) { return 404; }
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Services on another server
|
|
74
|
+
|
|
75
|
+
On the server with the services:
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
cewebs-aman service aman didaktiki https://services.example.org/CEWebS # once for every service
|
|
79
|
+
cewebs-aman addkey aman # for every website, prints the partner key
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
```nginx
|
|
83
|
+
location ^~ /CEWebS/aman/ { proxy_pass http://127.0.0.1:9021/; }
|
|
84
|
+
location ^~ /CEWebS/rman/ { proxy_pass http://127.0.0.1:9022/; }
|
|
85
|
+
location ^~ /CEWebS/wiki/ { proxy_pass http://127.0.0.1:9023/; }
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
On the server with the engine:
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
cewebs-transformationengine site engine /var/www/CEWebS <partner key> https://services.example.org/CEWebS
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
AMan and RMan have to be on the same server. AMan also has to reach the engine.
|
|
95
|
+
|
|
96
|
+
## License
|
|
97
|
+
|
|
98
|
+
GPL-3.0-or-later, see LICENSE.GPL. Bundled libraries, styles, and icons of others in `static` keep their own
|
|
99
|
+
licenses.
|
data/Rakefile
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
require 'rake'
|
|
2
|
+
require 'rubygems/package_task'
|
|
3
|
+
|
|
4
|
+
spec = eval(File.read('cewebs-transformationengine.gemspec'))
|
|
5
|
+
Gem::PackageTask.new(spec) do |pkg|
|
|
6
|
+
FileUtils.mkdir 'pkg' rescue nil
|
|
7
|
+
FileUtils.rm_rf Dir.glob('pkg/*')
|
|
8
|
+
FileUtils.ln_sf "#{pkg.name}.gem", "pkg/#{spec.name}.gem"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
task :default => :gem
|
|
12
|
+
|
|
13
|
+
task :push => :gem do |r|
|
|
14
|
+
sh "gem push pkg/#{spec.name}.gem"
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
task :install => :gem do |r|
|
|
18
|
+
sh "gem install pkg/#{spec.name}.gem"
|
|
19
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Gem::Specification.new do |s|
|
|
2
|
+
s.name = "cewebs-transformationengine"
|
|
3
|
+
s.version = "3.0.1"
|
|
4
|
+
s.platform = Gem::Platform::RUBY
|
|
5
|
+
s.license = "GPL-3.0-or-later"
|
|
6
|
+
s.summary = "Websites that consist of CEWebS services"
|
|
7
|
+
|
|
8
|
+
s.description = "A static page that loads everything with Ajax, and the engine that asks the services."
|
|
9
|
+
|
|
10
|
+
s.files = Dir['{static/**/*,server/**/*,tools/**/*,lib/**/*}'] + %w(index.html menupoints.rng LICENSE.GPL Rakefile cewebs-transformationengine.gemspec README.md AUTHORS)
|
|
11
|
+
s.require_path = 'lib'
|
|
12
|
+
s.extra_rdoc_files = ['README.md']
|
|
13
|
+
s.bindir = 'tools'
|
|
14
|
+
s.executables = ['cewebs-transformationengine']
|
|
15
|
+
|
|
16
|
+
s.required_ruby_version = '>=3.2'
|
|
17
|
+
|
|
18
|
+
s.authors = ['Juergen eTM Mangler']
|
|
19
|
+
s.email = 'juergen.mangler@gmail.com'
|
|
20
|
+
s.homepage = 'http://www.cewebs.org'
|
|
21
|
+
|
|
22
|
+
s.add_runtime_dependency 'cewebs-servicesbase', '~> 3.0'
|
|
23
|
+
s.add_runtime_dependency 'mimemagic', '~> 0.4'
|
|
24
|
+
s.add_runtime_dependency 'net-smtp', '~> 0.5'
|
|
25
|
+
end
|
data/index.html
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8"/>
|
|
5
|
+
<title>CEWebS</title>
|
|
6
|
+
<script>
|
|
7
|
+
// requested before engine.js is loaded, which uses the answer. Has to be before the stylesheets
|
|
8
|
+
var CEWebS_page = fetch('/CEWebSEngine/' + (location.pathname.split('/').slice(1, -1).join(':') || ':') + '/page?' + new URLSearchParams({ t: new URLSearchParams(location.search).get('t') || '' }));
|
|
9
|
+
</script>
|
|
10
|
+
<link rel="shortcut icon" href="static/styles/CEWebS.ico" type="image/x-icon"/>
|
|
11
|
+
<link rel="stylesheet" href="static/styles/content.css"/>
|
|
12
|
+
<link rel="stylesheet" href="static/styles/print.css" media="print"/>
|
|
13
|
+
<script src="static/js/engine.js" defer></script>
|
|
14
|
+
<script src="static/js/administration.js" defer></script>
|
|
15
|
+
</head>
|
|
16
|
+
<body hidden>
|
|
17
|
+
<div id="header">
|
|
18
|
+
<div class="back"></div>
|
|
19
|
+
<div class="title">
|
|
20
|
+
<h1 class="title1" id="title1"></h1>
|
|
21
|
+
<p class="title2" id="title2"></p>
|
|
22
|
+
</div>
|
|
23
|
+
<div class="bread"><span id="youarehere"></span> <span id="bread"></span></div>
|
|
24
|
+
<div class="hnav" id="hnav"></div>
|
|
25
|
+
<div class="search"></div>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div id="menu"><ul id="points"></ul></div>
|
|
29
|
+
|
|
30
|
+
<div id="contentcontainer">
|
|
31
|
+
<div id="content"></div>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div id="footer-right"><div id="access"></div></div>
|
|
35
|
+
<div id="footer-left">^'d by CEWebS; Backup provided by PRISM; <span id="contact"></span></div>
|
|
36
|
+
</body>
|
|
37
|
+
</html>
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
# Please see the LICENSE.GPL file for copyright and distribution information
|
|
2
|
+
require 'digest/sha2'
|
|
3
|
+
require 'net/smtp'
|
|
4
|
+
require 'openssl'
|
|
5
|
+
|
|
6
|
+
module Engine
|
|
7
|
+
# what a menu point or link leads to, only services that are opened directly have a description
|
|
8
|
+
Target = Struct.new(:name,:description,:url,:instance,:key,:locked,:command,:parameters,:registry,:keyword_init => true)
|
|
9
|
+
|
|
10
|
+
# A website is a directory with CEWebSData, anywhere in the root of the web server (see engine.xml).
|
|
11
|
+
# Its name is the path, with : instead of /. The root itself is just :
|
|
12
|
+
# Created by cewebs-transformationengine site:
|
|
13
|
+
# index.html the page, served by the web server
|
|
14
|
+
# static/ icons, scripts and stylesheets, served by the web server
|
|
15
|
+
# CEWebSData/custom.xml registries, services and menu points
|
|
16
|
+
# CEWebSData/persons.xml users, shared with the services
|
|
17
|
+
# CEWebSData/strings.xml texts
|
|
18
|
+
# CEWebSData/sessions/ who is logged in
|
|
19
|
+
# CEWebSData/resets/ links for a new password
|
|
20
|
+
# CEWebSData/attempts/ when somebody tried to log in
|
|
21
|
+
# CEWebSData/cache/ answers of the services, can be deleted at any time
|
|
22
|
+
class Site
|
|
23
|
+
ADMINISTRATION = 'CEWebSInternalAdministration'
|
|
24
|
+
REPORT = 'CEWebSInternalReport'
|
|
25
|
+
LINK = /CEWebS:\/\/([\w.-]+)\/(document|file|chunk|icon)\/([\w.-]+)/
|
|
26
|
+
NAME = /\A[\w-][\w.-]*(:[\w-][\w.-]*)*\z/
|
|
27
|
+
LOCK = Mutex.new
|
|
28
|
+
STATIC = File.expand_path(File.join(__dir__,'..','..','..','static'))
|
|
29
|
+
|
|
30
|
+
class << self
|
|
31
|
+
def config; XML::Smart.open(CEWebS::data('engine.xml')); end
|
|
32
|
+
|
|
33
|
+
def root; File.expand_path(config.find('string(/engine/sites/@root)')); end
|
|
34
|
+
|
|
35
|
+
# nil if there can not be a site
|
|
36
|
+
def name(directory) #{{{
|
|
37
|
+
dir, top = File.expand_path(directory), root
|
|
38
|
+
return ':' if dir == top
|
|
39
|
+
name = dir.delete_prefix(top + '/').tr('/',':')
|
|
40
|
+
dir.start_with?(top + '/') && name =~ NAME ? name : nil
|
|
41
|
+
end #}}}
|
|
42
|
+
|
|
43
|
+
# nil if there is no site. Data of somebody else could contain anything
|
|
44
|
+
def directory(name) #{{{
|
|
45
|
+
return nil unless name == ':' || name =~ NAME
|
|
46
|
+
dir = File.join(root,*name.split(':'))
|
|
47
|
+
File.owned?(File.join(dir,'CEWebSData')) && File.exist?(File.join(dir,'CEWebSData','custom.xml')) ? dir : nil
|
|
48
|
+
end #}}}
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
attr_reader :name
|
|
52
|
+
|
|
53
|
+
def initialize(name) #{{{
|
|
54
|
+
@directory = Site::directory(name) or raise CEWebS::Error.new('site not found',404)
|
|
55
|
+
@name = name
|
|
56
|
+
end #}}}
|
|
57
|
+
|
|
58
|
+
# relative to the root of the web server
|
|
59
|
+
def path; @name == ':' ? '' : @name.tr(':','/') + '/'; end
|
|
60
|
+
def file(*path); File.join(@directory,'CEWebSData',*path); end
|
|
61
|
+
def custom; XML::Smart.open(file('custom.xml')); end
|
|
62
|
+
def strings(language); XML::Smart.open(file('strings.xml')).lfind('/strings/strings',language); end
|
|
63
|
+
|
|
64
|
+
### users
|
|
65
|
+
|
|
66
|
+
def person(id) #{{{
|
|
67
|
+
return nil if id.to_s == ''
|
|
68
|
+
XML::Smart.open(file('persons.xml')).find('/persons/person').find { |p| p.attributes['id'].downcase == id.downcase }
|
|
69
|
+
end #}}}
|
|
70
|
+
|
|
71
|
+
def password?(person,password) #{{{
|
|
72
|
+
attempt('login',person,10) if person
|
|
73
|
+
# takes the same time for users that do not exist
|
|
74
|
+
valid = CEWebS::Password::valid?(person && person.attributes['pass'],password) || mailserver?(person,password)
|
|
75
|
+
FileUtils.rm_f(attempts('login',person)) if valid
|
|
76
|
+
valid
|
|
77
|
+
end #}}}
|
|
78
|
+
|
|
79
|
+
# only max times in 15 minutes
|
|
80
|
+
def attempt(what,person,max) #{{{
|
|
81
|
+
FileUtils.mkdir_p(file('attempts'),:mode => 0700)
|
|
82
|
+
File.open(attempts(what,person),File::RDWR|File::CREAT,0600) do |f|
|
|
83
|
+
f.flock(File::LOCK_EX)
|
|
84
|
+
times = f.read.split.map(&:to_i).select { |t| t > Time.now.to_i - 15 * 60 }
|
|
85
|
+
raise CEWebS::Error.new('too many attempts',429) if times.length >= max
|
|
86
|
+
f.rewind
|
|
87
|
+
f.truncate(0)
|
|
88
|
+
f.write((times << Time.now.to_i).join(' '))
|
|
89
|
+
end
|
|
90
|
+
end #}}}
|
|
91
|
+
|
|
92
|
+
# users without a password log in with the one of their mail account
|
|
93
|
+
def mailserver?(person,password) #{{{
|
|
94
|
+
return false if person.nil? || person.attributes['pass'].to_s != '' || password.to_s == ''
|
|
95
|
+
server = Site::config.find('/engine/login').first
|
|
96
|
+
return false if server.nil? || server.attributes['host'].to_s == ''
|
|
97
|
+
smtp = Net::SMTP.new(server.attributes['host'],server.attributes['port'].to_i)
|
|
98
|
+
smtp.enable_starttls
|
|
99
|
+
smtp.open_timeout = smtp.read_timeout = 5
|
|
100
|
+
smtp.start('localhost',person.attributes['id'],password,:login) { true }
|
|
101
|
+
rescue Net::SMTPAuthenticationError
|
|
102
|
+
false
|
|
103
|
+
rescue => e
|
|
104
|
+
puts "mail server: #{e.message}"
|
|
105
|
+
false
|
|
106
|
+
end #}}}
|
|
107
|
+
|
|
108
|
+
# returns the token for the cookie
|
|
109
|
+
def login(id,password,days) #{{{
|
|
110
|
+
person = person(id)
|
|
111
|
+
raise CEWebS::Error.new('login failed',403) unless password?(person,password)
|
|
112
|
+
pass = person.attributes['pass'].to_s
|
|
113
|
+
store(person,password) unless pass == '' || CEWebS::Password::hashed?(pass)
|
|
114
|
+
token = CEWebS::key
|
|
115
|
+
FileUtils.mkdir_p(file('sessions'),:mode => 0700)
|
|
116
|
+
File.write(session(token),"#{Time.now.to_i + days * 24 * 3600} #{person.attributes['id']}")
|
|
117
|
+
token
|
|
118
|
+
end #}}}
|
|
119
|
+
|
|
120
|
+
def user(token) #{{{
|
|
121
|
+
return nil unless CEWebS::key?(token) && File.exist?(session(token))
|
|
122
|
+
expires, id = File.read(session(token)).split(' ',2)
|
|
123
|
+
expires.to_i > Time.now.to_i ? person(id) : nil
|
|
124
|
+
end #}}}
|
|
125
|
+
|
|
126
|
+
def logout(token) #{{{
|
|
127
|
+
FileUtils.rm_f(session(token)) if CEWebS::key?(token)
|
|
128
|
+
end #}}}
|
|
129
|
+
|
|
130
|
+
# all other sessions of the user end, and links for a new password
|
|
131
|
+
def password(person,new,token) #{{{
|
|
132
|
+
store(person,new)
|
|
133
|
+
FileUtils.rm_f(attempts('login',person))
|
|
134
|
+
Dir.glob([file('sessions','*'),file('resets','*')]).each do |f|
|
|
135
|
+
FileUtils.rm_f(f) if f != session(token) && File.read(f).split(' ',2)[1] == person.attributes['id']
|
|
136
|
+
end
|
|
137
|
+
end #}}}
|
|
138
|
+
|
|
139
|
+
# Link for a new password, one hour. The address is the one an administrator has used,
|
|
140
|
+
# because the address of a request can be forged.
|
|
141
|
+
def reset_link(person) #{{{
|
|
142
|
+
location = custom.find('/custom/registries/registry/@location').map(&:to_s).find { |l| l != '' }
|
|
143
|
+
raise CEWebS::Error.new('address of the site not known',501) if location.nil?
|
|
144
|
+
token = CEWebS::key
|
|
145
|
+
FileUtils.mkdir_p(file('resets'),:mode => 0700)
|
|
146
|
+
File.write(reset_file(token),"#{Time.now.to_i + 3600} #{person.attributes['id']}")
|
|
147
|
+
URI.join(location,"../../#{path}index.html?m=RESET##{token}").to_s
|
|
148
|
+
end #}}}
|
|
149
|
+
def reset(token,new) #{{{
|
|
150
|
+
raise CEWebS::Error.new('link not valid',403) unless CEWebS::key?(token) && File.exist?(reset_file(token))
|
|
151
|
+
expires, id = File.read(reset_file(token)).split(' ',2)
|
|
152
|
+
FileUtils.rm_f(reset_file(token))
|
|
153
|
+
person = person(id)
|
|
154
|
+
raise CEWebS::Error.new('link not valid',403) if person.nil? || expires.to_i < Time.now.to_i
|
|
155
|
+
password(person,new,nil)
|
|
156
|
+
end #}}}
|
|
157
|
+
|
|
158
|
+
# nil removes the password
|
|
159
|
+
def store(person,new) #{{{
|
|
160
|
+
id = person.attributes['id']
|
|
161
|
+
raise CEWebS::Error.new('invalid user',400) if id =~ /["']/
|
|
162
|
+
path = "/persons/person[@id=\"#{id}\"]/@pass"
|
|
163
|
+
operation, xml = new ? ['valueAdd',CEWebS::Password::create(new)] : ['valueDelete','']
|
|
164
|
+
CEWebS::Configuration::apply(file('persons.xml'),operation,path,xml)
|
|
165
|
+
# the services also know the users
|
|
166
|
+
custom.find("/custom/registries/registry[@key!='']").each do |r|
|
|
167
|
+
begin
|
|
168
|
+
CEWebS::Remote.new(r.sfind('notification'),r.attributes['key']).call(:put,'persons',[['operation',operation],['path',path],['xml',xml]])
|
|
169
|
+
rescue => e
|
|
170
|
+
puts "#{r.attributes['name']}: #{e.message}"
|
|
171
|
+
end
|
|
172
|
+
end
|
|
173
|
+
end #}}}
|
|
174
|
+
|
|
175
|
+
### targets
|
|
176
|
+
|
|
177
|
+
# subject is the service the administration or report is about
|
|
178
|
+
def target(name,subject=nil) #{{{
|
|
179
|
+
doc = custom
|
|
180
|
+
if [ADMINISTRATION,REPORT].include?(name)
|
|
181
|
+
reg = doc.find("/custom/registries/registry[service/@name='#{subject.to_s[/\A\w+\z/]}']").first || doc.find('/custom/registries/registry').first
|
|
182
|
+
url = reg.sfind(name == REPORT ? 'report' : 'administration')
|
|
183
|
+
return Target.new(:name => name, :url => url, :instance => '0', :key => reg.attributes['key'], :command => 'show', :parameters => '', :registry => reg)
|
|
184
|
+
end
|
|
185
|
+
raise CEWebS::Error.new('target not found',404) unless name.to_s =~ /\A\w*\z/
|
|
186
|
+
command, parameters = 'show', ''
|
|
187
|
+
service = doc.find("/custom/registries/registry/service[@name='#{name}']").first
|
|
188
|
+
description = service.sfind('comment') if service
|
|
189
|
+
if service.nil?
|
|
190
|
+
points = doc.find("//point[@service!='plain' and @service!='spacer' and @service!='hyperlink']")
|
|
191
|
+
point = name.to_s == '' ? points.first : points.find { |p| p.attributes['name'] == name }
|
|
192
|
+
raise CEWebS::Error.new('target not found',404) if point.nil?
|
|
193
|
+
service = doc.find("/custom/registries/registry/service[@name='#{point.attributes['service']}']").first
|
|
194
|
+
raise CEWebS::Error.new('target not found',404) if service.nil?
|
|
195
|
+
name = point.attributes['name']
|
|
196
|
+
command, parameters = point.sfind('command'), point.sfind('parameters')
|
|
197
|
+
end
|
|
198
|
+
Target.new(
|
|
199
|
+
:name => name, :description => description, :url => service.sfind('delivery'), :instance => service.sfind('instance'), :key => service.attributes['key'],
|
|
200
|
+
:locked => service.attributes['locked'] == 'true', :command => command, :parameters => parameters
|
|
201
|
+
)
|
|
202
|
+
end #}}}
|
|
203
|
+
|
|
204
|
+
# CEWebS://{target}/{document|file|chunk}/{command} => url
|
|
205
|
+
# base is only necessary for texts that are not shown by the page
|
|
206
|
+
def links(text,target,engine,base='') #{{{
|
|
207
|
+
text.to_s.gsub(LINK) do
|
|
208
|
+
to, mode, command = $1, $2, $3
|
|
209
|
+
to = target if to == 'self'
|
|
210
|
+
case mode
|
|
211
|
+
when 'icon'
|
|
212
|
+
size = %w{small large tiny}.include?(to) ? to : 'small'
|
|
213
|
+
icon = [command + '.png',command + '.svg','image-missing.png'].find { |f| File.exist?(File.join(STATIC,'icons',size,f)) }
|
|
214
|
+
"#{base}static/icons/#{size}/#{icon}"
|
|
215
|
+
when 'document'; "#{base}index.html?t=#{to}&c=#{command}"
|
|
216
|
+
else "#{engine}content/#{mode}/#{command}?t=#{to}"
|
|
217
|
+
end
|
|
218
|
+
end.gsub('CEWebS-Link://','CEWebS://')
|
|
219
|
+
end #}}}
|
|
220
|
+
|
|
221
|
+
### search
|
|
222
|
+
|
|
223
|
+
# title and text of a page without markup, in one line
|
|
224
|
+
def self::plain(page) #{{{
|
|
225
|
+
CGI.unescapeHTML("#{page[:description]} #{page[:document].to_s.gsub(/<[^>]*>/,' ')}").gsub(/[[:space:]]+/,' ')
|
|
226
|
+
end #}}}
|
|
227
|
+
|
|
228
|
+
# entries of the cache that contain all words, their text is in {entry}.txt
|
|
229
|
+
def grep(words) #{{{
|
|
230
|
+
files = words.map do |w|
|
|
231
|
+
IO.popen([{ 'LC_ALL' => 'C.UTF-8' },'grep','-rliF','--include=*.txt','-e',w,'--',file('cache')],:err => File::NULL) { |io| io.readlines(:chomp => true) }
|
|
232
|
+
end
|
|
233
|
+
files.reduce(:&).to_a.sort.filter_map { |f| Marshal.load(File.binread(f.delete_suffix('.txt'))) rescue nil }
|
|
234
|
+
end #}}}
|
|
235
|
+
|
|
236
|
+
### services
|
|
237
|
+
|
|
238
|
+
def registry(id); custom.find('/custom/registries/registry').find { |r| r.attributes['id'] == id } || raise(CEWebS::Error.new('repository not found',404)); end
|
|
239
|
+
def repository(reg,language=nil); CEWebS::Remote.new(reg.sfind('repository'),reg.attributes['key'],:language => language); end
|
|
240
|
+
|
|
241
|
+
# element of a service and its repository
|
|
242
|
+
def service(name) #{{{
|
|
243
|
+
node = name =~ /\A\w+\z/ && custom.find("/custom/registries/registry/service[@name='#{name}']").first
|
|
244
|
+
raise CEWebS::Error.new('service not found',404) unless node
|
|
245
|
+
[node,node.parent]
|
|
246
|
+
end #}}}
|
|
247
|
+
|
|
248
|
+
# new repositories have no key, and have to know where the engine is
|
|
249
|
+
def register(address); locate { "#{address}/administration/#{@name}" }; end
|
|
250
|
+
|
|
251
|
+
# Repositories have to know if the directory has been moved. Only the name changes, because
|
|
252
|
+
# the address of a request can be forged. Nobody has to wait for it.
|
|
253
|
+
def moved #{{{
|
|
254
|
+
return if LOCK.locked? || custom.find('/custom/registries/registry/@location').all? { |l| ['',@name].include?(l.to_s[/[^\/]*\z/]) }
|
|
255
|
+
Thread.new { locate { |old| old.sub(/[^\/]+\z/,@name) } }
|
|
256
|
+
end #}}}
|
|
257
|
+
|
|
258
|
+
# a copy has the same key, the repositories stay with the original as long as it exists
|
|
259
|
+
def copy?(registry) #{{{
|
|
260
|
+
old = registry.attributes['location'].to_s[/[^\/]+\z/]
|
|
261
|
+
return false if old.nil? || old == @name || Site::directory(old).nil?
|
|
262
|
+
Site.new(old).custom.find('/custom/registries/registry/@key').any? { |k| k.to_s == registry.attributes['key'] }
|
|
263
|
+
end #}}}
|
|
264
|
+
|
|
265
|
+
def locate #{{{
|
|
266
|
+
LOCK.synchronize do
|
|
267
|
+
custom.find('/custom/registries/registry').each do |r|
|
|
268
|
+
link = yield(r.attributes['location'].to_s)
|
|
269
|
+
next if link == '' || (r.attributes['key'] != '' && (r.attributes['location'] == link || copy?(r)))
|
|
270
|
+
begin
|
|
271
|
+
id, key = r.attributes['id'], r.attributes['key']
|
|
272
|
+
if key == ''
|
|
273
|
+
res = CEWebS::Remote.new(r.sfind('repository'),nil).call(:post,'',[['key',r.attributes['authentication']],['link',link]])[1]
|
|
274
|
+
key = CEWebS::Messages::parse_list(res)[0][:key]
|
|
275
|
+
change(id,'key',key)
|
|
276
|
+
end
|
|
277
|
+
# the repository reads the configuration of the engine before it answers
|
|
278
|
+
CEWebS::Remote.new(r.sfind('repository'),key).call(:put,'',[['link',link]])
|
|
279
|
+
change(id,'location',link)
|
|
280
|
+
rescue => e
|
|
281
|
+
puts "#{r.attributes['name']}: #{e.message}"
|
|
282
|
+
end
|
|
283
|
+
end
|
|
284
|
+
end
|
|
285
|
+
end #}}}
|
|
286
|
+
|
|
287
|
+
def subscribe(registry,id,comment) #{{{
|
|
288
|
+
reg = registry(registry)
|
|
289
|
+
res = repository(reg).call(:post,'services',[['id',id],['comment',comment]])[1]
|
|
290
|
+
new = CEWebS::Messages::parse_list(res)[0]
|
|
291
|
+
modify do |doc|
|
|
292
|
+
num = doc.find('/custom/registries/registry/service/@name').map { |n| n.to_s[/\d+/].to_i }.max.to_i + 1
|
|
293
|
+
node = doc.find('/custom/registries/registry').find { |r| r.attributes['id'] == registry }.add('service',{ 'name' => "service#{num}", 'key' => new[:key], 'locked' => 'false' })
|
|
294
|
+
node.add('delivery',new[:delivery])
|
|
295
|
+
node.add('instance',new[:instance])
|
|
296
|
+
node.add('comment',comment)
|
|
297
|
+
end
|
|
298
|
+
end #}}}
|
|
299
|
+
|
|
300
|
+
def unsubscribe(name) #{{{
|
|
301
|
+
node, reg = service(name)
|
|
302
|
+
repository(reg).call(:delete,"services/#{node.attributes['key']}")
|
|
303
|
+
modify do |doc|
|
|
304
|
+
doc.find("//service[@name='#{name}']").delete_all!
|
|
305
|
+
doc.find("//point[@service='#{name}']").delete_all!
|
|
306
|
+
end
|
|
307
|
+
end #}}}
|
|
308
|
+
|
|
309
|
+
# menu points with the old name are also renamed
|
|
310
|
+
def rename(name,comment) #{{{
|
|
311
|
+
node, reg = service(name)
|
|
312
|
+
old = node.sfind('comment')
|
|
313
|
+
repository(reg).call(:put,"services/#{node.attributes['key']}",[['comment',comment]])
|
|
314
|
+
modify do |doc|
|
|
315
|
+
doc.find("//service[@name='#{name}']/comment").first.text = comment
|
|
316
|
+
doc.find("//point[@service='#{name}']/text").each { |t| t.text = comment if t.text == old }
|
|
317
|
+
end
|
|
318
|
+
end #}}}
|
|
319
|
+
|
|
320
|
+
def lock(name,locked) #{{{
|
|
321
|
+
service(name)
|
|
322
|
+
modify { |doc| doc.find("//service[@name='#{name}']").first.attributes['locked'] = locked ? 'true' : 'false' }
|
|
323
|
+
end #}}}
|
|
324
|
+
|
|
325
|
+
def menu=(xml) #{{{
|
|
326
|
+
new = XML::Smart.string(xml) rescue raise(CEWebS::Error.new('invalid menu',400))
|
|
327
|
+
valid = new.validate_against(XML::Smart.open(File.join(__dir__,'..','..','..','menupoints.rng')))
|
|
328
|
+
names = new.find('//point/@name').map(&:to_s)
|
|
329
|
+
raise CEWebS::Error.new('invalid menu',400) unless valid && names.uniq == names
|
|
330
|
+
modify { |doc| doc.find('/custom/menupoints').first.replace_by(new.root) }
|
|
331
|
+
end #}}}
|
|
332
|
+
|
|
333
|
+
private
|
|
334
|
+
|
|
335
|
+
def session(token); file('sessions',Digest::SHA256.hexdigest(token.to_s)); end
|
|
336
|
+
def reset_file(token); file('resets',Digest::SHA256.hexdigest(token.to_s)); end
|
|
337
|
+
def attempts(what,person); file('attempts',Digest::SHA256.hexdigest("#{what} #{person.attributes['id']}")); end
|
|
338
|
+
def modify(&blk); XML::Smart.modify(file('custom.xml'),&blk); end
|
|
339
|
+
def change(registry,attribute,value) #{{{
|
|
340
|
+
modify { |doc| doc.find('/custom/registries/registry').find { |r| r.attributes['id'] == registry }.attributes[attribute] = value }
|
|
341
|
+
end #}}}
|
|
342
|
+
end
|
|
343
|
+
end
|