The Ortus BlogBox

"Ortus: A rise, beginning, coming into being, born, the origin!"

 

 

Category Filtering: 'walkthroughs'

 

CBCMS2016 - Building your Own Admin Modules - Part 4 - Extending ContentBox 3

Gavin Pickin
Aug 11, 2016

 

Ready for part 4? Yes, part 4. We continue our small walkthrough of building your own Admin Module in ContentBox 3. The last few blog posts we learned the minimum requirements for a new module, to be controlled from inside of ContentBox. Then we learned how to add a handler and a view, and how to access the module from the front end entry point, and through the ContentBox admin entrypoint. In the last blog post in this mini series, we looked at adding a Submenu for your module, to an existing top level Menu item inside of the ContentBox admin. This blog post is going to show you how to add your very own top level Menu item, give it an icon, set permissions, and then add Submenu items to access your module.

ContentBox CMS, Modules, RoadShow, Walkthroughs 0

CBCMS2016 - Building your Own Admin Modules - Part 3 - Extending ContentBox 3

Gavin Pickin
Aug 09, 2016

 

In previous posts, we learned how to create a module inside of ContentBox, and then we added a handler and view so we could view the module behind the security of the login, but having an admin module, without menu items, is fairly silly ( usually ). In this blog post, we'll learn how you can add Submenu items to existing menus, like the Modules Main Menu.

ContentBox CMS, Modules, RoadShow, Walkthroughs 0

CBCMS2016 - Building your Own Admin Modules - Part 2 - Extending ContentBox 3

Gavin Pickin
Jul 29, 2016

 

In our last post, we started building an Admin Module. This process isn't actually that difficult or long, but we have broken it into separate blog posts to make it easier to read each piece. We have built our basic ModuleConfig.cfc, now we need to build an event handler and view, so the default action when you hit your new module have something visible. Our module was called mySecrets, so lets move on.

ContentBox CMS, Modules, RoadShow, Walkthroughs 0

CBCMS2016 - Building your Own Admin Modules - Part 1 - Extending ContentBox 3

Gavin Pickin
Jul 27, 2016

 

In previous posts, we looked at how to extend ContentBox 3 with ColdBox Modules, installing from Forgebox with CommandBox, or creating your own. In this post, we're going to look at how you can create your own Admin Modules, add Menu Items into the Admin Interface, use ContentBox admin Users and Permissions instead of building your own security by extending ContentBox.

ContentBox CMS, Modules, RoadShow, Walkthroughs 0

CBCMS2016 - ContentBox Administration 101 - For Admins, Managers, Editors and Users

Gavin Pickin
Jul 07, 2016

 

The ContentBox roadshow keeps on trucking, with this weeks free online webinar being presented on ContentBox Administration 101, by Jorge Reyes, on Friday, July 8th at 11am Central time. This is a great session, because it looks at ContentBox from an administrator or a users position. As developers at Ortus, we get excited about all the nuts and bolts under the covers, but for non developers, ContentBox is a quality enterprise level product, that anyone can use.

Please register to get updates, summaries, and all the recording links ( in case you cannot make the live webinars ).

Click here to register now

ContentBox CMS, Presentations, RoadShow, Tips & Tricks, Walkthroughs 0

Screencast showing off new ForgeBox 2.0 features in CommandBox 3.1.0 beta

Brad Wood
May 17, 2016

 

We recently announced the availability of CommandBox 3.1.0 beta for testing.  We've make a screen cast also showing how to start Adobe, Lucee 5, and Railo servers which you can view here.  We've also prepared this short screencast that shows how you now interact with the new ForgeBox 2.0 API via your command line to create users, and publish packages.   Check it out below.

If you'd like to see more, please check out our official announcement blog that overviews all of the CommandBox 3.1.0 beta features.

https://www.ortussolutions.com/blog/commandbox-v310-beta-ready-for-testing

CommandBox, Tutorials, Walkthroughs 0

Screencast showing how to start Adobe, Railo, and Lucee 5 servers in CommandBox

Brad Wood
May 16, 2016

 

We recently announced the availability of CommandBox 3.1.0 beta for testing.  We've also prepared this short screencast that shows starting up Adobe, Railo, and Lucee 5 servers in CommandBox.

If you'd like to see more, please check out our official announcement blog that overviews all of the CommandBox 3.1.0 beta features.

https://www.ortussolutions.com/blog/commandbox-v310-beta-ready-for-testing

CommandBox, Tutorials, Walkthroughs 3

Submit Your First Pull Request to an Open Source Project

Brad Wood
Sep 23, 2015

 

Update 10/10/2015 -- New tickets added!

Perhaps you're using open source projects with your work.  You've heard about how Git works, and maybe you even attended one of my sessions on how to submit pull requests. You've never actually tried to do one before though.  You were brave one day and clicked the "Fork" button in GitHub but were left staring at your keyboard wondering what the heck you could do to help out a project that wouldn't sink your entire weekend.

The Wait is Over

Ladies and gentlemen, boys and girls of all ages: your time has come.  Today we're breaking down all the walls keeping from being a productive member in the open source community.  Everything you need is documented and laid out in front of you.  Heck, for this to be any easier, I'd just have to do it for you!  If you've been waiting for just the right chance to come along to submit your first pull request, please keep reading. 

Today we are announcing a special program where we've created a handful of super-duper easy tickets for an assortment of Box products.  These are already entered into our ticket tracker and approved.  All we need is someone to complete them!  You don't even need to know how our products work to help out.  Each ticket spells out what amounts to a one-line change to get your feet wet and experience the process of submitting something that will release to the world in the next version of our product.  We'll even make sure to include your names in the release notes :)

You. Yes, you!

There's a little bit of a catch.  These special tickets are ONLY for people who have never submitted a pull request via GitHub before.  You know who you are.  If you've contributed before, we thank you so much but please step aside so someone who's never been a part of this process can give it a spin.  Please only take one of these tickets too.  If you really love this and want to help more in the future, don't worry-- we'll have lots of other opportunities to put your newly learned Git skillz to good use.  

What You Need to Do

Ok, we've made this super easy.  The tickets already exist in JIRA, but I would recommend creating a quick JIRA account so you can assign yourself to the ticket.  That way, we won't have two people trying to work on the same thing at once.  Here is our guide that covers signing up for a free JIRA account.

How To Create A JIRA Account And Enter ColdBox Tickets

Next, choose one of these simple tickets and assign it to yourself:

Next, follow the step-by-step guide here that will walk you through getting a copy of the code, making the change, and submitting that change back to us.

How To Submit Pull Requests to the ColdBox Platform

If you get stuck or have questions, no worries!  Just jump on the CFML Slack team and give a shout out in the #box-products channel.  Or you can shoot an E-mail off to our Google Group.

Thank You

You did it!  Today you have become part of something bigger than yourself.  You contributed to an open source project and it really wasn't that bad.  A new world of opportunity and collaboration has just opened up to you. Go ahead and kick back while you revel in your new found meaning.  In fact, take the rest of the day off-- I've already cleared it with your boss.

If you happen across this post and the 4 tickets above have already been gobbled up, please give a holler.  I will gladly create more easy-grab changes for first timers to try out.  This is important to CFML and at Ortus we understand that as much as anyone does.  We want CFML to succeed, and for that the CFML community needs to be engaged.  

ColdBox MVC, Community, Tutorials, Walkthroughs 0

How To Submit Pull Requests to the ColdBox Platform

Brad Wood
Aug 28, 2015

 

The best part about open source projects is you! Many hands make light work and at Ortus we love getting input from the many smart community members out there.  The first way you can help is to report bugs or enhancements in our ticket tracking system.  You can read our guide for that here:

http://blog.coldbox.org/blog/how-to-create-a-jira-account-and-enter-coldbox-tickets

The second thing you can do is to actually submit fixes yourself!  This may seem scary, but it's a pretty straight forward process once you've done it once.  We can never have too many people willing to help. Let's jump in and cover the steps it takes to submit some code to the ColdBox Platform.

Bugs, ColdBox MVC, Community, Tips & Tricks, Walkthroughs 1

Converting Fusebox 5.1 Sample App to ColdBox MVC - Part 2

Brad Wood
Aug 12, 2014

 

This is the second half of our two-part conversion of a FuseBox 5.1 sample app to ColdBox MVC.  If you haven't been following our blog series on converting your legacy FuseBox apps over to ColdBox MVC you may want to back up and read the previous post first..  In that post we took a look at the different files in each version of the app.  We talked about how each framework bootstraps itself up, as well as settings and circuits/handlers.  We'll pick up right were we left off in this post and finish off the code by looking at how we converted the views, models, and error handling.

Views

ColdBox will automatically look for a view file named after your action in a folder named after your handler.  Of course, all this happens in our "/views" convention folder.  You are free to name your view files whatever you want though.  Just use the following code to tell the framework what view to include:

// Include /views/randomFolder/randomFile.cfm
event.setView( "randomFolder/randomFile" );

Our views are almost identical.  There are two main differences.  The first is that our views "get" data from the handler by accessing the readily-available rc (request collection) and prc (private request collection) scopes.  rc is used for any input from the user via FORM or URL scopes.  prc is for any other data the handler wants to pass along to the view.  The second is in how we build links.

/view/listEmails.cfm

<a href="#self##xfa.conform#">Return to Connect Form</a>

/views/list.cfm

<a href="#event.buildLink( prc.xeh.conform )#">Return to Connect Form</a>

ColdBox gives you a nice helper method in the event object to build links for you.  It automatically handles HTTPS, the base domain, app mapping, and query string.  event.buildLink() can also generate SES URLs with no changes when you have it enabled.

Layouts

ColdBox layouts are placed in a folder called /layouts by default and unless you've specified something else, will look for a file called Main.cfm.

/layouts/Main.cfm

<cfoutput>
	<html>
		<head>
			<link href="/includes/getmymail.css" rel="stylesheet" type="text/css" />
		</head>
		<body>
			#renderView()#
		</body>
	</html>	
</cfoutput>

The renderView() call is where the output from the view will be placed.

Model

Your models are your services, beans, and DAO that represent the business logic in your application.  In ColdBox, these go under a folder called /model.  I created a MailService.cfc which encapsulates getting a list of messages and getting a single message.  

/model/MailService.cfc

component singleton {
	property name="attachmentPath" inject="coldbox:setting:attachmentPath";
	property name='sessionStorage' inject='coldbox:plugin:sessionStorage';
	
	function getAllMessages( required numeric start	) {
		// Get connection Info
		var connectionInfo = sessionStorage.getVar( 'connectionInfo' );
		
		return new pop().getHeaderOnly(
			server = connectionInfo.serverName,
			username = connectionInfo.userName,
			password = connectionInfo.password,
			port = connectionInfo.serverPort,
			maxrows = connectionInfo.msgsPerPage,
			startrow = arguments.start
		);
	}
	
	function getMessage( required string uid ) {
		// Get connection Info
		var connectionInfo = sessionStorage.getVar( 'connectionInfo' );
				
		return new pop().getAll(
			server = connectionInfo.serverName,
			username = connectionInfo.userName,
			password = connectionInfo.password,
			port = connectionInfo.serverPort,
			uid = arguments.uid,
			attachmentpath = attachmentPath,
			generateuniquefilenames = true
		);
	}	
}

Note the singleton annotation at the top in the component definition.  This tells WireBox to only create one instance of this service that the entire application shares.  I'm also using properties to inject a reference to my attachmentPath setting as well as the sessionStorage plugin again.  No configuration is necessary for WireBox to find the MailService CFC since we've placed it in the /model convention folder.  Unfortunately, I found that Railo doesn't support the same script syntax for the CFPOP tag so I also created a RailoMailService.cfc file in the /model folder and created the following WireBox configuration file.

/config/WireBox.cfc

component extends='coldbox.system.ioc.config.Binder' {
	function configure() {		
		// Use this to detect the CFML engine
		var CFMLEngine = new coldbox.system.core.util.CFMLEngine(); 
		
		// Railo uses a different script syntax
		if( CFMLEngine.getEngine() == CFMLEngine.RAILO ) {
			// This will override the default MailService mappings
			map( 'MailService' ).to( 'model.RailoMailService' );		
		}
		
		// No "else" needed for Adobe CF. WireBox will simply "find" the 
		// "MailService" CFC in the "/model" folder automatically.		
	}
}

This file uses a utility built into ColdBox called CFMLEngine to detect the engine in use and conditionally overwrite the MailService mapping to point to the Railo version.

Error Handling

In the FuseBox code, there are try/catches around a lot of code in the "model" files.  If an error occurs, a custom error page is included.  

<cftry>
<cfpop  .../>
	<cfcatch>
		<cfinclude template="../view/error/connectionError.cfm" />
	</cfcatch>
</cftry>

What if an error occurs somewhere else in the request though?  What if you add new code and forget to wrap it in a try/catch.  Even worse, what if you decide to rename your error template after it's referenced everywhere?  In ColdBox, error handling is built in.  All of your code is run in a try/catch at the framework level, and there's a nice default error template that displays.  In your production settings though, you'll want to override this to a more secure page that doesn't divulge information with the customErrorTemplate setting.

customErrorTemplate = "includes/templates/oops_sorry.cfm"

You can read more about the exception handling provided to you in ColdBox here.

Conclusion

To see all the code, please visit this repo on GitHub: https://github.com/bdw429s/FuseBox-5.1-Sample-App-Conversion

This sample app was a little more involved than the last one, and hopefully everything makes sense even though I included a lot more code.  If clone the Git repo you can unzip the FuseBox code and open them side by side.  Please comment below if you have any questions or suggestions, and here's our list of handy resources:

 

 

ColdBox MVC, Sample Apps, Tips & Tricks, Tutorials, Walkthroughs 0
1 2 3 4 5 6 >>