added: Export plugin (not finished yet)
added: ThreadManager
all threads are connected to the ThreadManager
they are started/stopped by the manager
changed: FunctionParser
now we are parsing directly what is in URI
(we were using GetParser beforehand)
we are able to recognize ordinary URI scheme (with '?' and '#' characters)
sample:
http://domain.com/dir1/dir2/item/function?par1=val2&par2=val2#htmlanchor
is the same as:
http://domain.com/dir1/dir2/item/function/par1:val2/par2:val2#htmlanchor
'htmlanchor' is put in Request::anchor field,
and the default function can be used like this:
http://domain.com/dir1/dir2/item?par1=val2&par2=val2#htmlanchor
but there is not an equivalent in winix form
e.g. http://domain.com/dir1/dir2/item/par1:val2/par2:val2#htmlanchor
because 'par1:val2' would be treated as a function name
removed: GetParser
now we don't have Request::get_tab structure
removed: CKEditorGetParser
it is not needed now
git-svn-id: svn://ttmath.org/publicrep/winix/trunk@752 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
27
plugins/export/Makefile
Executable file
27
plugins/export/Makefile
Executable file
@@ -0,0 +1,27 @@
|
||||
include Makefile.o.dep
|
||||
|
||||
name = export.so
|
||||
|
||||
|
||||
all: $(name)
|
||||
|
||||
$(name): $(o)
|
||||
$(CXX) -shared -Wl,-soname,$(name).so -o $(name) $(CXXFLAGS) *.o
|
||||
|
||||
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) -c $(CXXFLAGS) $<
|
||||
|
||||
|
||||
|
||||
depend:
|
||||
makedepend -Y. -I../.. -I../../../ezc/src -f- *.cpp > Makefile.dep
|
||||
echo -n "o = " > Makefile.o.dep
|
||||
ls -1 *.cpp | xargs -I foo echo -n foo " " | sed -E "s/([^\.]*)\.cpp[ ]/\1\.o/g" >> Makefile.o.dep
|
||||
|
||||
clean:
|
||||
rm -f *.o
|
||||
rm -f $(name)
|
||||
|
||||
include Makefile.dep
|
||||
56
plugins/export/Makefile.dep
Executable file
56
plugins/export/Makefile.dep
Executable file
@@ -0,0 +1,56 @@
|
||||
# DO NOT DELETE
|
||||
|
||||
exportthread.o: exportthread.h ../../core/basethread.h ../../core/synchro.h
|
||||
exportthread.o: message.h
|
||||
init.o: ../../core/log.h ../../core/textstream.h ../../core/misc.h
|
||||
init.o: ../../core/item.h ../../core/requesttypes.h
|
||||
init.o: ../../core/logmanipulators.h ../../core/slog.h ../../core/cur.h
|
||||
init.o: ../../core/request.h ../../core/error.h ../../core/config.h
|
||||
init.o: ../../core/confparser.h ../../core/htmlfilter.h
|
||||
init.o: ../../templates/htmltextstream.h ../../core/textstream.h
|
||||
init.o: ../../core/session.h ../../core/user.h ../../core/plugindata.h
|
||||
init.o: ../../core/rebus.h ../../core/mount.h ../../templates/locale.h
|
||||
init.o: ../../core/confparser.h ../../core/plugin.h ../../core/pluginmsg.h
|
||||
init.o: ../../core/log.h ../../core/system.h ../../core/dirs.h
|
||||
init.o: ../../core/dircontainer.h ../../db/db.h ../../db/dbbase.h
|
||||
init.o: ../../db/dbconn.h ../../db/dbtextstream.h ../../core/error.h
|
||||
init.o: ../../db/dbitemquery.h ../../core/item.h ../../db/dbitemcolumns.h
|
||||
init.o: ../../core/user.h ../../core/group.h ../../core/dircontainer.h
|
||||
init.o: ../../core/ugcontainer.h ../../notify/notify.h
|
||||
init.o: ../../notify/notifypool.h ../../templates/misc.h
|
||||
init.o: ../../templates/localefilter.h ../../templates/locale.h
|
||||
init.o: ../../../ezc/src/ezc.h ../../../ezc/src/utf8.h
|
||||
init.o: ../../../ezc/src/generator.h ../../../ezc/src/pattern.h
|
||||
init.o: ../../../ezc/src/functions.h ../../../ezc/src/funinfo.h
|
||||
init.o: ../../../ezc/src/stringconv.h ../../templates/htmltextstream.h
|
||||
init.o: ../../notify/notifythread.h ../../core/basethread.h
|
||||
init.o: ../../core/synchro.h ../../notify/templatesnotify.h
|
||||
init.o: ../../core/config.h ../../core/users.h ../../core/ugcontainer.h
|
||||
init.o: ../../core/lastcontainer.h ../../core/mounts.h
|
||||
init.o: ../../core/mountparser.h ../../core/crypt.h ../../core/run.h
|
||||
init.o: ../../core/users.h ../../core/groups.h ../../core/group.h
|
||||
init.o: ../../core/loadavg.h ../../core/thumb.h ../../core/basethread.h
|
||||
init.o: ../../core/threadmanager.h ../../core/sessionmanager.h
|
||||
init.o: ../../core/sessioncontainer.h ../../functions/functions.h
|
||||
init.o: ../../functions/functionbase.h ../../core/request.h
|
||||
init.o: ../../core/system.h ../../core/synchro.h
|
||||
init.o: ../../functions/functionparser.h ../../core/cur.h
|
||||
init.o: ../../functions/adduser.h ../../functions/cat.h
|
||||
init.o: ../../functions/chmod.h ../../functions/privchanger.h
|
||||
init.o: ../../functions/chown.h ../../functions/ckeditor.h
|
||||
init.o: ../../functions/cp.h ../../functions/default.h
|
||||
init.o: ../../functions/download.h ../../functions/emacs.h
|
||||
init.o: ../../functions/last.h ../../functions/login.h
|
||||
init.o: ../../functions/logout.h ../../functions/ln.h ../../functions/ls.h
|
||||
init.o: ../../functions/mkdir.h ../../functions/mv.h
|
||||
init.o: ../../functions/nicedit.h ../../functions/node.h
|
||||
init.o: ../../functions/passwd.h ../../functions/priv.h
|
||||
init.o: ../../functions/reload.h ../../functions/rm.h
|
||||
init.o: ../../functions/specialdefault.h ../../functions/stat.h
|
||||
init.o: ../../functions/subject.h ../../functions/template.h
|
||||
init.o: ../../functions/tinymce.h ../../functions/uname.h
|
||||
init.o: ../../functions/upload.h ../../functions/uptime.h
|
||||
init.o: ../../functions/who.h ../../functions/vim.h ../../core/htmlfilter.h
|
||||
init.o: ../../templates/templates.h ../../templates/patterncacher.h
|
||||
init.o: ../../templates/indexpatterns.h ../../core/sessionmanager.h
|
||||
init.o: exportthread.h message.h
|
||||
1
plugins/export/Makefile.o.dep
Executable file
1
plugins/export/Makefile.o.dep
Executable file
@@ -0,0 +1 @@
|
||||
o = exportthread.o init.o
|
||||
43
plugins/export/exportthread.cpp
Executable file
43
plugins/export/exportthread.cpp
Executable file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2011, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "exportthread.h"
|
||||
|
||||
|
||||
namespace Export
|
||||
{
|
||||
|
||||
|
||||
void ExportThread::AddMessage(const Message & message)
|
||||
{
|
||||
message_tab.insert(message_tab.end(), message);
|
||||
}
|
||||
|
||||
|
||||
void ExportThread::AddMessage(int type, const std::wstring & url, const std::wstring & path)
|
||||
{
|
||||
message_add_temp.type = type;
|
||||
message_add_temp.url = url;
|
||||
message_add_temp.path = path;
|
||||
|
||||
AddMessage(message_add_temp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace
|
||||
43
plugins/export/exportthread.h
Executable file
43
plugins/export/exportthread.h
Executable file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2011, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfile_winix_plugins_export_exportthread
|
||||
#define headerfile_winix_plugins_export_exportthread
|
||||
|
||||
#include <list>
|
||||
#include "core/basethread.h"
|
||||
#include "message.h"
|
||||
|
||||
|
||||
|
||||
namespace Export
|
||||
{
|
||||
|
||||
|
||||
class ExportThread : public BaseThread
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
void AddMessage(const Message & message);
|
||||
void AddMessage(int type, const std::wstring & url, const std::wstring & path);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
typedef std::list<Message> MessageTab;
|
||||
MessageTab message_tab;
|
||||
Message message_add_temp;
|
||||
|
||||
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
#endif
|
||||
81
plugins/export/init.cpp
Executable file
81
plugins/export/init.cpp
Executable file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2011, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "core/log.h"
|
||||
#include "core/plugin.h"
|
||||
#include "exportthread.h"
|
||||
|
||||
|
||||
extern "C" void Init(PluginInfo &);
|
||||
|
||||
|
||||
|
||||
|
||||
namespace Export
|
||||
{
|
||||
|
||||
|
||||
const wchar_t plugin_name[] = L"export";
|
||||
int mount_par_export_conf = -1;
|
||||
ExportThread export_thread;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void AddMountParams(PluginInfo & info)
|
||||
{
|
||||
using TemplatesFunctions::system;
|
||||
|
||||
mount_par_export_conf = system->mounts.AddMountPar(L"export_conf");
|
||||
}
|
||||
|
||||
|
||||
|
||||
void FstabChanged(PluginInfo & info)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void SendFile(PluginInfo & info)
|
||||
{
|
||||
Item & item = *reinterpret_cast<Item*>(info.p1);
|
||||
|
||||
log << log1 << "bedziemy wysylac strone o tytule: " << item.subject << ", url: " << item.url << logend;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void AddEzcFunctions(PluginInfo & info);
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void Init(PluginInfo & info)
|
||||
{
|
||||
using namespace Export;
|
||||
|
||||
// plugin.Assign(WINIX_TEMPLATES_CREATEFUNCTIONS, AddEzcFunctions);
|
||||
plugin.Assign(WINIX_ADD_MOUNTS, AddMountParams);
|
||||
// plugin.Assign(WINIX_FSTAB_CHANGED, FstabChanged);
|
||||
|
||||
|
||||
plugin.Assign(WINIX_FILE_ADDED, SendFile);
|
||||
plugin.Assign(WINIX_FILE_CHANGED, SendFile);
|
||||
|
||||
info.p1 = (void*)(plugin_name);
|
||||
}
|
||||
|
||||
|
||||
37
plugins/export/message.h
Executable file
37
plugins/export/message.h
Executable file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2011, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef headerfile_winix_plugins_export_message
|
||||
#define headerfile_winix_plugins_export_message
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
|
||||
// message types
|
||||
#define WINIX_PL_EXPORT_TYPE_CREATE_FILE 1
|
||||
#define WINIX_PL_EXPORT_TYPE_CREATE_DIR 2
|
||||
|
||||
|
||||
|
||||
struct Message
|
||||
{
|
||||
// message type
|
||||
int type;
|
||||
|
||||
// original (source) url
|
||||
std::wstring url;
|
||||
|
||||
// output file (directory) name
|
||||
// relative path
|
||||
std::wstring path;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user