spacelimitations,itwasbrokenupintwolineshere):
native2ascii -encoding UTF-8 8 ApplicationResources_ru.properties_native e ApplicationResources_ru.properties
4. Restart t the application server. All language files s in folder OPINIO_HOME/WEB-INF/classes/i18n will l be
automaticallyloadedafterserverrestart.
Createyourownplugin
Introductiontoplugins
Apluginisapieceofsoftwarethatcanbe"pluggedinto"asoftwaresystemwithoutanymodificationofthissystem.
Opinioprovidestheframeworkthatmakesthispossible.PluginswasimplementedtomakeOpiniomoreextensible
and customizable. . Nomatterhow w muchfunctionality is s includedintheproduct, there are always somespecial
featuresneededbyvarioususers.
Thepluginframeworkimposescertainrequirementsthatthepluginmustmeet,butnorestrictionsonthedesignon
whattypeoffunctionalitythisplugincanoffer.Thissectiondescribeswhatapluginmustdo,inordertomeetthis
requirements.
Towriteaplugin,Javaskillsarerequired.SometimemustalsobespenttounderstandhowOpinioworks. This
knowledgeisdonebyusingtheproduct,andlookingthroughthepluginAPI(includedintheOpiniodistribution).
ThepluginAPIislimitedtothemethodcallsthatwasregardedasusefultoplugindevelopers.Thereisevenmore
functionalityavailableinOpinio,butnotyetofferedthroughthePluginAPI.ObjectPlanetwelcomesanysuggestions
toimproveorextendthisAPI,ifthesuggestedchangeisreasonable.Pleaseletusknow,andwewillgladlyconsider
yoursuggestions.Pleasegoheretoletusknow:http://www.objectplanet.com/Opinio
Important
Writingapluginputsgreatresponsibilityinthehandsofthepluginauthor.Asmallandsimpleplugincan
potentiallybreakthestabilityoftheentiresystem.ThePluginAPImustbeunderstoodbeforeusingit.And
beforeyougoliveusingtheplugin,testitwell.Thentestitagain.
Pluginarchitecture
BelowisaUMLdiagramoftheclassesandPluginAPIusedbytheplugins.Theclass"MyPlugin"iswrittenbythe
plugindeveloper(you).
http://www.objectplanet.com/Opinio/
233
Split pdf files - Split, seperate PDF into multiple files in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Explain How to Split PDF Document in Visual C#.NET Application
pdf format specification; break pdf into multiple pages
Split pdf files - VB.NET PDF File Split Library: Split, seperate PDF into multiple files in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
VB.NET PDF Document Splitter Control to Disassemble PDF Document
can't select text in pdf file; how to split pdf file by pages
Asseenfromthisimage,yourpluginmustinheritfromtheclassPlugin:
public class s MyPlugin n extends Plugin implements s IEventListener {
• IfyouwanttheplugintoactonsomeeventsinOpinio,thenyourpluginmustimplementtheIEventListener
interface. This s is necessary y for the plugin to receive Events s fromthe PluginBus (more on n that in the next
chapter).
• If f yourplugin will have some other functionality, , thenit t must implement the corresponding interface. . For
example,todoyourownlogincheckyoucanwriteaLoginPlugin,whichmustimplementILogininterface.
YourpluginwillinheritfromthePluginclass,whichisdeclaredabstract.Inthecurrentversion(6.0),thereareno
abstractmethods,soyourplugindoesnothavetoimplementanymethods.Thismaybechangedinlaterversions.
Fortheplugintodoanythinguseful, youshouldoverrideoneormoreofthepluginmethods, likethestart()and
stop()methods.Theincludedexample,theResponseNotifierPlugin,showshowtodothis.
Important
Thepluginnamemustendwith"Plugin".
http://www.objectplanet.com/Opinio/
234
Online Split PDF file. Best free online split PDF tool.
Easy split! We try to make it as easy as possible to split your PDF files into Multiple ones. You can receive the PDF files by simply
pdf split pages; acrobat split pdf into multiple files
VB.NET PDF File Merge Library: Merge, append PDF files in vb.net
File: Merge, Append PDF Files. |. Home ›› XDoc.PDF ›› VB.NET PDF: Merge and Append PDF. VB.NET Demo code to Combine and Merge Multiple PDF Files into One.
pdf split pages in half; break pdf password
Theeventbus
TheeventbusclassesareimportantifyouwantyourplugintoactoncertaineventsinOpinio.Forexample,whena
respondenthascompletedasurvey,youwanttodosomethingwiththedata(likesendinganemail).Toknowwhen
thisrespondenthascompleted,youneedtoreceiveaneventnotification.
Toreceivethisnotification,thepluginmustregisteritselfontheeventbus.Thereareseveralbustypesandmany
eventtypesineachbus.Seeom.objectplanet.survey.event.EventBusManagerintheplugindocumentation.
Examplesofbustypes:
• BUS_TYPE_SURVEY-Surveyresponsebus:handlestheeventsintheSurveymodule.Examplesofeventtypes
are:DisplayQuestionEvent,NewRespondentEvent,RespondentCompleteEvent,ResponseEventandsoon.
• BUS_TYPE_SURVEY_MANAGEMENT-Surveydesignbus:handlesadministrationmoduleevents.Whenanew
survey is s created, for r example, , a NewSurveyEventis fired. Examples of f eventtypes s are:NewSurveyEvent,
SurveyDeletedEvent,QuestionDeletedEventandsoon.
• BUS_TYPE_USER-Usereventbus:handlesuseradministrationevents.WhenanewOpiniouseriscreated,for
example, a a NewUserEvent t is fired. . Examples of f event t types s are: NewUserEvent, PreUserDeleteEvent,
UserDeletedEventandsoon.
ThereareseveraladdListener(**)methodsintheEventBusManager.Youcanregistertolistento:
• alleventsinthesystem(everysingleone)-useaddListener(IEventListenerlistener)method
• alleventsonaspecificbustype-useaddListener(IEventListenerlistener,intbusType)
• specificeventtypesentonthespecificbus-useaddListener(IEventListenerlistener,intbusType,inteventType)
• specificeventtypesentonthespecificbusforaparticularresource-useaddListener(IEventListenerlistener,int
busType,inteventType,longresourceId)
ThereareseveraladdListener(**)methodsintheEventBusManager.Youcanregistertolistento:
IMPORTANT:Trytoregistereventsonaslowlevelaspossibletomaximizetheperformance.
Example13.1.Pluginexample
Implementcom.objectplanet.survey.event.IEventListenerinterface.
Inthestart()methodofyourplugin,youcanregisteryourplugintolistentotheadministrationevents:
public void start() {
EventBusManager eventMgr = = EventBusManager.instance();
eventMgr.addListener(this, EventBusManager.BUS_TYPE_SURVEY_MANAGEMENT, , EventBusManager. . EVENT_TYPE_NEW_SURVEY);
}
Implement the handleEvent() method from IEventListener interface, so that the e events received d are handled
correctly.Forexample:
public void handleEvent(PluginBusEvent t event) ) {
if (event t instanceof NewSurveyEvent) ) {
NewSurveyEvent nsEvent t = = (NewSurveyEvent) ) event;
http://www.objectplanet.com/Opinio/
235
VB.NET PDF Convert to HTML SDK: Convert PDF to html files in vb.
' Convert PDF file to HTML5 files DocumentConverter.ConvertToHtml5("..\1.pdf", "..output\", RelativeType.SVG). Copyright © <2000-2016> by <RasterEdge.com>.
break pdf password online; split pdf into multiple files
C# PDF Convert to HTML SDK: Convert PDF to html files in C#.net
How to Use C#.NET Demo Code to Convert PDF Document to HTML5 Files in C#.NET Class. Add necessary references: RasterEdge.Imaging.Basic.dll.
split pdf by bookmark; break pdf into pages
long surveyId = nsEvent.getSurveyId();
// Do o something with the survey; ; send an n email,
//
call an n external l system m etc.
....
}
}
Pluginsetup
Allpluginscanhaveasetupscreenaccessiblefromthepluginlist.Thesetupisavailableonlyforuserswithall
accessrights(superusers).Tocreateasetupscreenforyourplugin,implementthetwomethods
• getSetupHTML(HashMapresources)-themethodiscalledbyOpiniowhendisplayingthesetupscreenforthe
plugin.
• processSetupHTML(HashMapresources)-themethodiscalledwhenuserclicksontheSavebutton.Thevalues
fromthesetupscreenaresenttothemethod.
MethodgetSetupHTML(HashMapresources).
GetstheHTMLcodeforpluginsetupscreen.ThecodemustincludeallHTMLneededbetweentheformtags.For
example,thecodecouldbe:
public String g getSetupHTML(HashMap p resources) {
StringBuffer html = = new w StringBuffer();
html.append("<table>");
html.append("
<tr>");
html.append("
<td class='form m label'>Name:</td>");
html.append("
<td class='form m value'><input type=text name=plugin_name class='width200'></td>");
html.append("
</tr>");
html.append("
<tr>");
html.append("
<td class='form m label'>Address:</td>");
html.append("
<td class='form m value'><input type=password d name=plugin_address class='width200'></td>");
html.append("
</tr>");
html.append("
<tr>");
html.append("
<td class='form'></td>");
html.append("
<td class='form m value'><input type=submit value='Save' name=plugin_savebutton n class='button'></td>");
html.append("
</tr>");
html.append("</table>");
return html.toString();
}
example,thecodecouldbe:
Important
Allinputfieldnamesmuststartwith"plugin".Thisistoavoidanyconflictswithanyfieldsproducedby
Opinio.
example,thecodecouldbe:
Theexampleincludestwofields:"plugin_name"and"plugin_address".Whentheuserentersthevaluesandclicks
thesubmitbutton(mustalsobeprovidedinthecode),Opiniowillreceivetheformandreturnitthroughacalltothe
processSetupHTML(HashMapresources)method.Itisthenuptotheplugintoprocessthesetuphtml.Thismethod
isnotrequiredbytheplugin.Ifnotimplemented,astandardno-optextisreturned.
Itisrecommendedthatthelook&feelofOpinioisused.
http://www.objectplanet.com/Opinio/
236
C# PDF File Merge Library: Merge, append PDF files in C#.net, ASP.
File: Merge, Append PDF Files. |. Home Our .NET PDF SDK empowers C# programmers to easily merge and append PDF files with mature APIs. To
break apart pdf pages; pdf split and merge
XDoc, XImage SDK for .NET - View, Annotate, Convert, Edit, Scan
process. 100+ images. Learn More. PDF XDoc.PDF. .NET PDF SDK to Edit, Convert,. View, Write, Comment PDF files. Learn More. OFFICE XDoc
split pdf by bookmark; break pdf into multiple files
MethodprocessSetupHTML(HashMapresources).
TheprocessSetup()methodiscalledbyOpinio,andmaylooklikethis:
public ProcessResult processSetupHTML(HashMap resources) {
// retrieve request t object t from resources
HttpServletRequest request = (HttpServletRequest) ) resources.get(PluginConstants.RESOURCE_HTTP_REQUEST);
String nameValue = request.getParameter("plugin_name");
String addressValue e = = request.getParameter("plugin_address");
... // do o something with the e values
return new w ProcessResult("The plugin n configuration n was saved successfully", false);
}
TheprocessSetup()methodiscalledbyOpinio,andmaylooklikethis:
Itisuptotheimplementor(developer)ofthismethodtoprocessthevaluesappropriately.Themethodreturnsthe
resultobjectwithmessagetoshowtotheuser.Lettheuserknowwhathappenedwiththeprocessingoftheform
values. If f null returned, the e plugin n list screen will be displayed. If f result t of type confirmation is s returned,
confirmationmessage willbe displayed, basedonuserpreferences. Ifresultoftype erroris returned, the error
message will l be displayed d over the setup screen n html. . Note that t ProcessResult t of type e error r is returned, the
getSetupHTML(HashMap)willbecalledagain.Implementthelogicthatretrievesthevaluesfromtherequestand
putthevaluestotheformfields,sothatusercancorrectthem.
Remember,itisuptothepluginauthortomakethesetupvaluespersistent.Functionalityformakingthiseasierwill
be added d in future e versions. Look k in the e example plugin n included d with h the e distribution n on how w to make e the
configurationpersistent.
Pluginfunctions
PluginscanbeappendedtotheMenuboxbyimplementingoneoftheinterfacesinpackage
com.objectplanet.survey.plugin.interfaces.menu
PluginscanbeappendedtotheMenuboxbyimplementingoneoftheinterfacesinpackage
Oneplugincanhavemultiplefunctions.EachfunctionwillappearasalinkintheMenubox.
http://www.objectplanet.com/Opinio/
237
C# PDF Convert to SVG SDK: Convert PDF to SVG files in C#.net, ASP
file using C#. Instantly convert all PDF document pages to SVG image files in C#.NET class application. Perform high-fidelity PDF
cannot select text in pdf; break pdf into smaller files
VB.NET PDF Convert to SVG SDK: Convert PDF to SVG files in vb.net
Convert Jpeg to PDF; Merge PDF Files; Split PDF Document; Remove Password from PDF; Change PDF Permission Settings. FREE TRIAL: HOW TO:
cannot print pdf no pages selected; reader split pdf
Numberoffunctions.
NumberoffunctionsprovidedbuthepluginsisreturnedbygetFunctionCount()methodinthePlugin.Ifyourplugin
provide2functions,justreturnthenumber2.
Functionlabel.
Method getFunctionLabel(int t functionNo, HashMap resources) ) should d return a a descriptive e name e of f the plugin
function.ThenamewillappearintheMenuboxaslinklabel.
public String g getFunctionLabel(int functionNo, , HashMap p resources) ) {
switch (functionNo) {
case 1:
return "Recognize address";
case 2:
return "Recognize name";
}
return "Unsupported function";
}
function.ThenamewillappearintheMenuboxaslinklabel.
Functionsecurity.
Pluginisselfresponsibleforpermissionchecks.ThiscanbedonebyimplementingmethodhasFunctionAccess(long
http://www.objectplanet.com/Opinio/
238
userId,intfunctionNo,HashMapresources)
Functionhtml.
GetstheHTMLcodeforpluginfunction.ThecodemustincludeallHTMLneededbetweentheformtags.Hereis
examplepluginwithtwofunction:Whentheuserenters the valuesandclicks the submitbutton n (must alsobe
public String g getFunctionHTML(int functionNo, , HashMap p resources) {
StringBuffer pluginFunctionHTML L = = new StringBuffer();
switch (functionNo) {
case 1:
pluginFunctionHTML.append("<table>");
pluginFunctionHTML.append(" <tr><td d class='form m label'>Your r mail address:</td>");
pluginFunctionHTML.append("
<td class='form m value'>");
pluginFunctionHTML.append("
<INPUT TYPE='text' ' class=width200 name='plugin_email' value=''>");
pluginFunctionHTML.append("
</td>");
pluginFunctionHTML.append(" </tr>");
pluginFunctionHTML.append(" <tr><td></td><td d class=buttons>");
pluginFunctionHTML.append("
<INPUT TYPE=submit t class=button n value='Ok'>");
pluginFunctionHTML.append("
</td>");
pluginFunctionHTML.append(" </tr>");
pluginFunctionHTML.append("</table>");
break;
case 2:
pluginFunctionHTML.append("<table>");
pluginFunctionHTML.append(" <tr><td d class='form m label'>Your r name:</td>");
pluginFunctionHTML.append("
<td class='form m value'>");
pluginFunctionHTML.append("
<INPUT TYPE='text' ' class=width200 name='plugin_name' value=''>");
pluginFunctionHTML.append("
</td>");
pluginFunctionHTML.append(" </tr>");
pluginFunctionHTML.append(" <tr><td></td><td d class=buttons>");
pluginFunctionHTML.append("
<INPUT TYPE=submit t class=button n value='Ok'>");
pluginFunctionHTML.append("
</td>");
pluginFunctionHTML.append(" </tr>");
pluginFunctionHTML.append("</table>");
break;
}
return pluginFunctionHTML.toString();
examplepluginwithtwofunction:Whentheuserenters the valuesandclicks the submitbutton n (must alsobe
providedinthecode), OpiniowillreceivetheformandreturnitthroughacalltotheprocessFunctionHTML(int
functionNo,HashMapresources)method.Itisthenuptotheplugintoprocessthehtml.Itisrecommendedthatthe
look&feelofOpinioisused.
Processingfunctionhtml.
TheprocessFunctionHTML(intfunctionNo,HashMapresources)methodiscalledbyOpiniowhenusersubmitsthe
functionpage.Exampleofthemethodimplementation:
public ProcessResult processFunctionHTML(int functionNo, HashMap resources) {
// retrieve request t object
HttpServletRequest request = (HttpServletRequest) ) resources.get("HttpRequest");
// process s the html based on n function number
switch (functionNo) ) {
case 1:
String email = = request.getParameter("plugin_email");
if (email l == = null || email.equals("")) ) {
return new ProcessResult("Email cannot t be e blank!", true);
}
return new ProcessResult("Entered d email is s " " + + email, , false);
case 2:
String name = = request.getParameter("plugin_name");
if (name e == = null || | name.equals("")) ) {
return new ProcessResult("Name cannot be blank!", , true);
http://www.objectplanet.com/Opinio/
239
}
return new ProcessResult("Entered d name is s " " + + name, false);
}
return super.processFunctionHTML(functionNo, , resources);
}
ThemethodreturnsProcessResultobjectwithmessagetoshowtotheuser.Lettheuserknowwhathappenedwith
theprocessingoftheformvalues.Ifnullreturned,thepluginfunctionscreenwillbedisplayedagain.Ifresultoftype
confirmationisreturned,confirmationmessagewillbedisplayed,basedonuserpreferences.Ifresultoftypeerroris
returned, the error r message willbe displayed overthe function html. Note that ProcessResult oftype error is
returned, the processFunctionHTML(int, , HashMap)will be e called again. Implement the logic that retrieves the
valuesfromtherequestandputthevaluestotheformfields,sothatusercancorrectthem.
Pluginsource.Thesourceofthispluginexamplecanbefoundinthedistribution:SurveyFunctionExamplePlugin
Plugininterfaces
The previous chapterdemonstrateshowtoaddmore functionalitytoOpinio. Butsometimes functionalityinthe
administrationmodulemustbechangedtobestsuityourneeds.Forthis reason, theplugininterfaces havebeen
developedandaddedtothepluginarchitecture.Nowaplugincan"overwrite"somepartsofdefaultOpiniocode.
Todothisthepluginmustimplementaninterfacedefiningthepluginbehavior.Allexistinginterfacescanbefound
inthepackagecom.objectplanet.survey.plugin.interfaces.Moreinterfaceswillbeaddedintheupcomingversions.
Forexample, LoginPluginimplementsloginfunctionality,whichwillbeusedinsteadofdefaultloginprocedure.
ThenitmustimplementILogininterface.Thisexampleisincludedinthedistribution.RefertotheILoginapifor
moredetails.
public class s LoginPlugin n extends s Plugin n implements ILogin n {
Attention:Thepluginwillbeautomaticallyregisteredinthesystemonweb-serverstart-up.Onlyonepluginforeach
interfacecanexist.Iftherearemorethanoneplugin,it'simpossibletosaywhichoftheexistingpluginswillbeused.
Pluginscreenslookandfeel
It'srecommendedtousethesamelookandfeelasotherOpinioscreens.Herearesomemainclassesusedinhtml
forms:
• tables-use"table"class"sectionTable"forthemainformtable
• heading-use"td"class"sectionTitle"forthemainheading
• Labelcell-use"td"class"formlabel"fortextlabels(labelbeforetheinputfields)
• Inputfield/valuecell-use"td"class"value"forcellswithinputs,liketextfield,textarea,checkbox,etc
• Inputfield/Textarea-use"input"class"width100"/"width200"/"width300".Tohighlighttheerrorfield,addclass
"error".Forexample"width200error"
• Checkbox-use"input"class"checkbox"
• Radio-use"input"class"radio"
• Buttonscell-use"td"class"buttons"
• Button-use"input"class"button"
http://www.objectplanet.com/Opinio/
240
Thepluginapi
ThepluginAPIprovides accesstothefunctionalityofOpinio. Togetaccesstothe pluginAPI, addthisimport
statementatthetopofyourPluginjavaclass:TogetanunderstandingoftheAPIclasses,andtheirmethods,look
import com.objectplanet.survey.plugin.api.*;
statementatthetopofyourPluginjavaclass:TogetanunderstandingoftheAPIclasses,andtheirmethods,look
themupintheAPI(javadoc)documentation.AcloserlookattheincludedPluginexamplewillalsohelp.
Theproperties
Allpluginsneedapropertyfile,sothatOpiniocangetcertainbasicinformationabouttheplugin.Thisincludesthe
pluginname(asdisplayedintheOpiniosetupscreen),author,version,buildnumber,helpfileURL(notusedyet).
Thepropertyfileshouldbeinthesamefolderasthejavaandclassfileswhenbuilding/compilingtheplugin.
ThenameofthepluginpropertyfileshouldbeMyPlugin.props
Theselinesmustbeincludedinthepropertiesfile:
plugin.ResponseNotifierPlugin.name=My first plugin
plugin.ResponseNotifierPlugin.author=Peter Pluginson
plugin.ResponseNotifierPlugin.version=1.0
plugin.ResponseNotifierPlugin.build=beta 1
plugin.ResponseNotifierPlugin.docs=MyPluginHelp.html
plugin.ResponseNotifierPlugin.depend.java=1.4
plugin.ResponseNotifierPlugin.depend.Opinio.major=4
plugin.ResponseNotifierPlugin.depend.Opinio.minor=0
Theselinesmustbeincludedinthepropertiesfile:
Compilingtheplugin
Tocompileandbuild theplugin, , werecommendusingtheANTbuildtoolfromApache. Itcanbefoundhere:
http://ant.apache.org.ThesamplepluginincludesabuildscriptforAnt(build.xml)thatbuildstheentireplugin,and
createsaJarfilereadyforuse.
Tocompile, youneedtospecifythepathtotheopinio.jarfile,whichislocatedintheWEB-INF/libfolderafter
installation(or youcansimplyunzip the opinio.war file). . Thefollowing g linesinthebuild.xmlfile needs s tobe
configured:
<property name="opinio.lib.dir"
value="../lib"/>
<property name="jar.name" " value="MyPlugin.jar"/>
<property name="jar.dir" " value="."/>
<property name="deploy.dir" " value="opinio/WEB-INF/plugins"/>
configured:
• opinio.lib.dir:Thelocationoftheopinio.jarfile.
• jar.name:Thenameoftheplugin.IfyourpluginiscalledMyPlugin,thisfilenamemustbeMyPlugin.jar.
• jar.dir:Thefolderwherethenewlycompiled/packagedpluginshouldbeplaced.
• opinio.lib.dir:IfOpinioisinstalledonyoursystem,thenyoucanrunthe"dist_copy"targettocopythepluginjar
filedirectlyintotheOpiniopluginsfolder,tomakeiteasiertodeveloptheplugin.(anAnttargetisa"step"inthe
buildscript,andeachtargetcanberunindependently,orinsequence,dependingonhowthescriptiswritten).
http://www.objectplanet.com/Opinio/
241
Oncetheselinesinthebuild.xmlscriptarecorrectlysetup,thepluginshouldcompile.Oncecompiled,allthefiles
forthepluginispackagedinajarfile.Thisshouldbeinsertedintotheopinio/WEB-INF/pluginsfolder.Opiniowill
trytoloadthepluginautomaticallywhenstarting.Ifyoudon'tseetheplugininthesetupscreenafterrestart,lookin
thelogfilesfortheapplicationserverforanyerrors.
Ifthepluginisplacedinajavapackage,thereareacoupleofthingstoremember.Youmustplacethe.javafilesin
foldersthatequalsthepackagenames,sothatthecompiled.classnamesareplacedinthesefolders.
Also,inthepropertiesfile(.props), youmustusethe fullnameoftheplugin, likethis:Thereissampleplugin,
plugin.testpackage.MyPlugin.name=MyPlugin
plugin.testpackage.MyPlugin.author=Torgeir Lund
plugin.testpackage.MyPlugin.version=1.0
plugin.testpackage.MyPlugin.build=beta 1
plugin.testpackage.MyPlugin.docs=MyPlugin.html
plugin.testpackage.MyPlugin.depend.java=1.4
plugin.testpackage.MyPlugin.depend.Opinio.major=4
plugin.testpackage.MyPlugin.depend.Opinio.minor=0
Also,inthepropertiesfile(.props), youmustusethe fullnameoftheplugin, likethis:Thereissampleplugin,
NewSurveyLogger,includedinthedistributionfilethatisimplementedthisway.
http://www.objectplanet.com/Opinio/
242
Documents you may be interested
Documents you may be interested