Dynamic Web based template designer to generate pdfs (from database data) [closed] - php

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I am currently working on a project for which I haven't found a solution yet, although i've been searching the web (stackoverflow included, obviously) for nearly 2 days.
The company i am working for has the need of gerating several kinds of pdfs: machine/product labels (small ones with info), product trial/test reports (typically A4 size, several values), and any other kind that shows up. All the company's data is the cloud in SQL-Server and the application needs to be web based as well, so that it can be used by anyone around the world (Suppliers, clients, colaborators).
Basically, some years ago a php script was done using TCPDF so the IT guys could create report templates programatically, that could be used anywhere. Nowadays, they use the same script but they create the templates in a web application done in VB.NET but it is not the perfect solution because it is full of bugs and limitations.
What is expected is an application that anyone (from the receptionist to the administrator) can use, that allows the generation of a custom template that will later be used to generate pdfs with the desired data fetched from their database.
As far as I see, there are 3 options:
1 - Use some kind of commercial or free tool which is already done and being used by other companies. Although it seems odd, i couldn't find a tool for this. How come there isn't one, considering that basically any big company needs to generate several types of pdfs everyday?
2 - Correct the existing VB.net application and php script, extending its functionality and reliability;
3 - Come up with a completely new approach for this. I've been thinking in creating a web app that allows people to drag and drop elements so that they can build the desired template (vb.net?c#?). Export this template to xml/json. Use this template and the set of fetched vars from the database to generate the pdf using any of the available tools (FPDF, TCPDF, or any other kind of php tool [php is desired to maintain the usability of the current working templates]).
I would really appreciate any kind of input, brainstorm or wild ideas.

One idea would be to look at JasperReports. It can output templates to PDF. I believe it can also run as an applet.
For a more modern look, you could write an ajax client that talked to a java server to call Jasper there.

This is certainly a common requirement - customisable templates for reports/documents. Web-editing facilities are one way of approaching the problem, but it seems very hard to get the web-ui to marry well to an output PDF (pagination alone is a significant roadblock).
Docmosis (a commercial document generation engine) seems like a pretty good fit here for providing the customisable-template capability and output to PDF etc. Because the "templates" are basic word or openoffice writer documents anyone can edit them (though some templates become complex enough you would avoid this for some customer/user groups).
A common implementation (which sounds like a solution to one of your key requirements) using Docmosis is to provide a set of templates in the application and allow the users to download, modify then upload back into the system. The templates take immediate effect and Docmosis has some interesting features to assist users detect and find errors in their template (such as writing errors into the produced PDF/doc as footnotes to describe what is wrong).
Please note I work for the company that created Docmosis.
I hope that helps.

Related

Web Design Practices? Mostly HTML or PHP? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I had just learned web development a while ago and made a a very novice site to practice. It looks terrible, but it's something to show I tried. I had extremely poor structure, didn't follow any standards, was using templates in Adobe Dreamweaver, etc. I had stopped working on it because of the vast amount of things that needed to be accounted for when making a website and starting learning some programming.
Now I'm trying to get back into it and do everything properly. I added a forum to the site and took a look at some of the source files to try to get a feel for how the pros do it. EVERYTHING was php. All the html was generated in PHP and the forum looked great.
What I want to know is how professional web-developers structure their sites. Mainly HTML with some php includes and things here and there, or mainly or even completely PHP? I understand that the forum is reading from databases and is most efficient when using PHP, but does this apply to most websites too? When I go to Facebook or Google or some web-developers custom-made blog, is that mostly PHP?
I know this can be considered quite subjective to the taste of the developer, but I have no clue where the middle ground lies here.
If it's at all possible, I would love to see some of the source files of the developers reading this.
Also, what programs are used? Just a text editor with syntax highlighting? Are the pages tested by uploading them or, do people have PHP servers installed to test the includes and things?
When I go to Facebook or Google or some web-developers custom-made
blog, is that mostly PHP?
First of all, there are numerous development languages and methodologies, and you owe it to yourself to examine at least a few.
http://en.wikipedia.org/wiki/Web_development
This list doesn't account for the fact that companies (like Google) heavily extend existing technologies or roll their own (e.g. Google and Yahoo design their own hardware from scratch, at least in some cases).
Also, what programs are used? Just a text editor with syntax
highlighting?
You can write code in any text editor, but projects quickly benefit from file organization, autocomplete, visual designers (sometimes), code refactoring tools, test coverage tools, etc. etc.
What I want to know is how professional web-developers structure their
sites. Mainly HTML with some php includes and things here and there,
or mainly or even completely PHP?
This question is independent of PHP. In brief, logic should be separated from presentation and shared functionality should be reused. The MVC pattern is very popular for achieving this.
Speaking of mainstream sites, it's my opinion (based on a few facts) that MySpace lost a great deal of market share due to not having a properly abstracted architecture that supported rapid deployment of new features and high performance.
I have no idea where to go from here. I knew there were a lot of
options and structures, but I was hoping for an example or some
starting point.
There is no one "correct" starting point, but if you like PHP and you are starting to recognize some of the right/wrong ways to do things, you are headed in the right direction. Look for a better editor if needed. Read a few articles on basic design patterns and best practices; they are all over the web.
If you want to branch out a little, download the free version of Visual Studio 2010 and try a .NET MVC web project. You can literally install, create a new project, and click the "Play" button to run.
What you are asking is how to separate content from logic, which is the tip of the iceberg of the larger question of scope when it comes to web page/web app development. One problem with coming up with a "best practice" or generally-approved model is that what might be the best design might not actually work in every browser or work on a mobile device, etc. But one thing to research is the idea of http://en.wikipedia.org/wiki/Business_logic, which aims to separate the aspects of a site/page into various scopes or layers.
I'm not an expert on the topic, but the general idea is to have a Data Layer (from the db), a Logic Layer (your php/web server logic), and a presentation layer (your html). To prevent too much overlap between the logic and presentation layer, many designers adopt an html template system, like Smarty, so that you can have your static HTML page marked up with the dynamic parts (user name, data table values, etc), and the PHP assigns those values to the template variables to be filled in.
Another aspect of this topic is the separation of your presentation layer itself. This generally breaks down into : Document layer (the actual HTML body), Presentation Layer (the look of the document, handled by CSS), and the Interactive layer (anything that should happen while the user is viewing the page, handled by javascript). These get pretty tangled into each other as well, but keeping them as cleanly separated as possible greatly helps your initial issue, as it helps prevent writing PHP that writes HTML that handles all three aspects. Instead, your PHP might only write the document, and the CSS and JS handles everything else once it loads.
What I want to know is how professional web-developers structure pick the technologies for their sites.
Companies use whatever they like, there is no such thing as best language for the web. They pick the technologies that suit their problem set and resources. There is not only PHP, there is ASP.NET, JavaServer Faces for example, and a lot more.
With HTML5 and Javascript libraries like jQuery, KnockoutJS or Dojo Toolkit for example, you can build awesome dynamic websites. I think that is somewhere to start learning, and also use an editor like Notepad++. Note that with a text editor you force yourself to look at the code so you practice it and understand it; I would not prefer the Dreamweaver way. Also, you can challange yourself to make your sites valid against W3C, and by doing so you will increase the quality of your site and code.
As you get more comfortable, you can proceed with PHP and/or the framework based on your preferred language, like CodeIgniter for PHP, which is great for learning MVC. It is a long journey to become an experienced web developer, so take your time. You will have your own best practises and preferences, and with time you will find out how you can do better.
If it's at all possible, I would love to see some of the source files
of the developers reading this.
As for coding styles, you can seek through existing questions, I think there are some for every language.

How do I increase the height of drag and drop area in wdCalendar(JQuery Event Calendar Plugin) [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Anybody familiar with wdCalendar ,a google look a like event calendar plugin in jquery .
I got this from http://www.web-delicious.com/jquery-plugins/.
I need to increase the drag and drop area of wdcaledar. I installed fresh copy from there site .it works well .But When I installed it to my site ,mine have a header portion ,that takes 200px height ,then the draggabble area misplaced .So I cannot drag events to bottom area. I've checked so many times in the code ,but couldn't find a good solution . Any explanation? Thanks!
My advice, if you don't know java, don't start doing web application development. Web application development goes as far as designing the system or architecting your application.
As for web application framework, use the currently available Java EE web application framework, JSF. Again, there are tons of tutorials on the web on how to use JSF (even good blog by an avid SO geek, BalusC). This assumes you already have knowledge of Enterprise Application, such as Servlet.
You will have to start from the beginning, like all of us did: understand Servlet and Filters, as every web application framework, including REST frameworks are built on top of it. You will need to.
Start writing a simple servlet web application and once you understand Servlet, move to MVC type framework, such as Struts, or jump to Component-based MVC such as JSF.
I'd recommend Oracle's official tutorial: http://docs.oracle.com/javaee/6/tutorial/doc/bnadp.html
I know you asked for "freely available" but I'm going to highly recommend the java certification as a way to get a develop a good all round understanding of the core language. The certification book is excellent, and the certification itself will provide you with a learning goal, even if you are not really that interested in the piece of paper(which I wasn't).
I feel that it's very important to have an understanding of the core before trying to embark on the many other facets provided by the Java architecture.
I think yo have to first start with core java then move to advance. you may refer headfirst of java.
A good introductory book is
"Head First Servlets & JSP - passing the sun certified web component developer exam." from O'Rielly
It starts right from the basics, I wish I'd known about it when I started out. Although there is a lot of stuff on the web, a lot of it is basic to the point of being dangerous and you cna end up structuring your applications very poorly.
I'd also recommend getting some Jave experience first, just try writing a few that output text to the console.

Are there PHP tools to generate CRUD screens from DB schema? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've been using phpMyEdit to quickly generate CRUD screens for databases; it's a quick way to start interacting with data in my projects (and lets me toss together internal admin pages fast)... but it doesn't read the DB schema, so I have to manually set it up.
I'm looking for a tool/way to quickly generate CRUD from beginning to end: I give it a DB table, and it reads the schema, generates the HTML markup for the form, and does the CRUD work on the db itself.
Does this exist? My goal is to have zero setup for basic functionality, and then I'd love the option of being able to extend that basic setup to further refine the experience. (For example: if it can see my database table has four varchar() fields, that would be ready to go with four editing fields "out of the box," but then I'd like to be able to add a little bit of code/set some flags to specify the one varchar() column that is meant to hold an email address, so the tool would then do data validation to only allow emails in that field.)
UPDATE: I'm seeking a solution that I can drop into my existing PHP project(s) -- not an entire framework.
The Yii Framework Does this out of the box. You use a web gui to plug in the database table name and it generates crud screens and active record classes along with all the models, views, and controllers.
Try Grocery CRUD: http://www.grocerycrud.com/
It's based on codeigniter and is quick to setup basic CRUD.
I'm looking for a drop-in admin like this too, here's one I found so far:
http://ajaxcrud.com/
I think just about anything you might be interested in will require some front-end configuration or parameter setting.
One tool that I've heard of is TTswiftcoder - v2.6. One of it's nice features is its cost ($0.00).
I think there are plenty of tools around - both free and not-so-free. Try googling phrases like PHP Crud, PHP data grid, PHP code generator and the like. Also try Sourceforge, Freshmeat, phpclasses, Codango , ...
Hope this helps.
Have you tried CoughPHP? https://github.com/awbush/coughphp
Cough generates all the code you need
for managing the object
model-to-relational model mapping.
This includes simple methods for all
your CRUD functionality. This also
includes Cough Collection classes that
represent the relationships between
tables in your data model.
and: http://www.coughphp.com/docs/1.1/data_validation/

PHP CMS with powerful in-place editing? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm looking for a good, clean PHP-based CMS that has as powerful in-place editing functions as Apostrophe which is great, but out of the question because of its strong reliance on Symphony and command-line tools that I can't use for this project. (As discussed in this question, with a nice contribution from one of Apostrophe's developers! You don't get that every day.)
"In-place" means that almost all editing work (adding content, deleting content, managing media...) takes place in the front-end of the web site, with a small menu in the screen's corner leading to everything else.
Consequently executed, this is an extremely intuitive approach that is very easy to use for end-users a whole lot because of the "point-click-and-type" philosophy.
Does anybody have any solid recommendations?
Take a look at Concrete 5. It used to be proprietary but not anymore and is built using the Zend Framework.
Another CMS that has similar (if not better) functionality but is fairly new is ImpressPages.
Drupal has no seperate backend, all front end stuff. You can use admin panel to still create a good lookin admin panel in your front end though.
All content basically has the tabs
- view
- edit
- revisions
- translate
And any other action you can undertake, same with users.
Drupal's pro's are simple build(no MVC or OOP), large open source community, thousands of modules and module writing for Drupal isn't very complicated.
I see you tagged this wysywig, Drupal allows simple switching between editors and allowed input formats when editing content. :)
Hope this helps.
Try out Pimcore. It provides inline editing and previewing each page in an easy manner.
Demo video of drag & drop interface
Demo video of editing a page
It's built on top of Zend Framework and pretty easy to extend.
"In-place" means that almost all
editing work (adding content, deleting
content, managing media...) takes
place in the front-end of the web site
[...]
Well, the admin is at /admin but there are "preview" buttons for the view of the page currently being edited, and the WYSIWYG does a very good job with keeping a similar layout of the actual layout of the page (i.e. inserting inputs and other form controls right on the elements).
I looked at quite a lot of CMS's and at the end of the day I found this one.
GetSimple
http://get-simple.info/
Its a really great, tiny CMS that is just a very simple and efficient CMS that is easily modifiable.
There is a such a great saying, "With great power comes great responsibility", for me the worst thing that could happen is if you CMS is hacked, goes down and you cannot figure out what software update caused it, I think you are going to stress a lot. Get Simple is very elegant, small and easy to work with.
Highly recommended but might not be suitable for everyone.
It took alot of searching to find this but it sounds like Exponent CMS is your best bet for getting as close to Apostrophe as you can. I provided the wiki link so you could view the demo link at the bottom and the website link for downloading.
No matter what CMS you go with you will need to learn the syntax and methods. Symfony "can" be done all manually by just creating the files yourself instead of having the symfony file create them for you. Should you need to run command line commands, you could always run exec() from php.
There seem to be at least 2 wordpress plugins that enable in place editing.
I don't know what features Apostrophe offers and neither did I try the WP-plugins so I can't compare them.

Do you know a good book/website about structuring your codes (PHP/ Web programming) [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
i mainly use PHP and I have been coding using it for a while. My main problem with PHP is that I think as your program gets bigger, it gets harder to maintain your code (probably applies for other things). I want to reduce this complexity in maintaining/modifying my codes. I want to make things modular and have rules when to start a new class or just append to an existing class (for example). I know that there are frameworks out there (CakePHP, Symfony, Rails) but what if I just want to use my PHP and use a hybrid of my own style and an existing style for good code management?
This is not just pertaining to php, this applies to coding in general. Frameworks will only help you organize your mess but if you are new to programming a framework will only organize your messy code.
Some basic ideas to keep in mind aside from undertaking a undergraduate in computer science (which i recommend if you are serious about coding) is to make your code modular.
For example, and this is a simply example to demonstrate the point. If you have a site that generates an html table containing financial data.
(Here are a few scenarios of how to go about coding this ...)
You open up a new screen, financialdata.php, you code from line 1 to line N the code needed to get the financial data from a data source (database perhaps) and then iterate over the financial
data to construct an html table.
You open up a new screen, financialData2.php, you code a function at the top which pulls data from yuor data source and returns an object (array maybe) containing the items. You take this return value and generate your table on this financialData2.php page.
You open up yet another new screen, financialData3.php, you take your database function from financialData2.php and use it to get your financial Data from yoru source. You code another function to generate an html table based on some arguments passed in as parameters. And lastly in your financialData3.php page you display do the following and your page now has a table containing financial data from your data source.
The lesson here: the more modular your code is the better in a lot of ways. You now have a data base function that can get data, and you have a function that will render a table based on a list of items passed in.
You can now create another page and use these functions in different ways, perhaps your data source function has parameters like table and selection criteria. This way you can use the same data function to get data from different tables based on criteria. You now have a VERY basic data abstraction. (Dont let abstraction scare you aware). An abstraction is nothing more then a simplification of something. In this case we have abstracted away the details of how we get data and let our function getData take care of those details.
Please comment/ask questions and we can discuss further but honestly, I do not think one book or web site can teach programming practice like a BS in CSE can through classroom discussion and hands on practice.
Learn Design Patterns:
http://sourcemaking.com/design_patterns (covers the GOF patterns)
http://martinfowler.com/eaaCatalog/index.html (covers POEAA obviously)
Also helpful to increase code quality:
http://phpqatools.org/
A sidenote on frameworks:
while frameworks often do tell you how you should layout your code and folders and stuff, they rarely tell you how to code properly. A framework offers solutions to common problems and that's cool, but if you try to step outside of what the framework already offers in terms of functionality, you are on your own again. That is because frameworks are concrete implementations, while you want to learn about design principles.
This is about code in general (it uses Java/C/.Net for the examples if I remember correctly), but Code Complete's the best book I've read on general code structure. It covers everything, from the nuts & bolts of how to write and organise variables and methods up to program structure. I'm not sure how applicable the examples are to PHP but probably worth a look.
http://www.nettuts.com
everything you'll want to know about PHP and web development.
I like this one: http://www.wrox.com/WileyCDA/WroxTitle/Professional-PHP5.productCd-0764572822,descCd-tableOfContents.html
http://www.amazon.ca/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612
Lots of design patterns explained. But not in PHP. Good for understanding useful design patterns. Support the author by purchasing it.

Categories