Wednesday, April 29, 2009

Liferay Custom Themes w/ Velocity Macros

Here's a tip.  If you have multiple custom themes and they're all using macros, if the macros get customized for a specific theme, you have to rename them to be theme specific.  Otherwise, the macros will get cached based on whichever theme renders first when the portal opens despite being in different application contexts.  It's a major macro pain in the butt to figure out this particular problem.

Friday, April 24, 2009

Liferay Extension Environment Protip

If you aren't developing portlets or services in the ext environment, don't delete the reports example from your ext folder.  You will get errors like:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionAdvice' defined in class path resource [META-INF/base-spring.xml]: Cannot resolve reference to bean 'liferayTransactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liferayTransactionManager' defined in class path resource [META-INF/hibernate-spring.xml]: Cannot resolve reference to bean 'liferayHibernateSessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liferayHibernateSessionFactory' defined in class path resource [META-INF/hibernate-spring.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: entity class not found: com.ext.portlet.reports.model.impl.ReportsEntryImpl

Got the info from this forum thread. It looks like some oddity about the way they're using AOP.

Tuesday, April 21, 2009

New Liferay Book Coming Out

The upcoming book "Liferay Portal 5.2 Systems Development" promises to be helpful.  I think I finally realized why they make development so painful and unintuitive.  Liferay is so hard to develop, it makes me wish they used Maven.  For the record, I hate Maven.

Tuesday, April 14, 2009

Liferay Protip

When you set up a new Liferay site that serves users with emails from multiple domains, be sure to set "company.login.prepopulate.domain=false" inside your portal-ext.properties file.  That way you don't get @liferay.com in the login box which will get you a lot of emails from people not sure how to log in.  I think it should be the default, but that's apparently just me.  I also edited the new account and password reset emails to explicitly say "Login with the email blah@example.com and this password."  This has been my number one user issue so far.

Thursday, April 02, 2009

Samsung Omnia Quick Review

The Omnia is an iPhone clone for Verizon Wireless. It's got 802.11b/g wireless and a 5 megapixel camera.

Good:
  • Windows Mobile is a kickass operating system with lots of available software to do absolutely anything.
  • The camera is awesome. It will actually focus and the pictures look really nice if your subject isn't moving. It's a slow shutter, but still the best phone camera I've ever seen.
  • You just use normal headphones with a 3.5mm plug and their connector cable has a microphone for when you want to talk while driving or whatever.
  • The wi-fi is nice even though it eats up your battery.
  • It includes Opera Mobile.
  • There is an optical trackpad (like a mini-version of the mouse pad on laptops or like an optical mouse turned upside down) for when you can't point accurately enough. It's a nice backup feature.

Bad:
  • The touchscreen is slow to respond to your input.
  • The stylus isn't built in.
  • The antenna gets bad reception. Calls will drop a lot if you touch the wrong part of the phone.
  • Contacts and Company Directory aren't integrated (only matters if you use Active Sync)
  • It takes two button presses to open the Contacts page. Because people dial numbers from memory all the time in this day and age.
  • The screen is glossy and acts like a mirror in the sun.
  • Voice commands either aren't easy to use or just don't work. I still haven't managed to get this to work despite much effort.
  • The GPS is completely useless. It has never worked no matter how out in the open I am. GPS that Verizon Wireless wasn't going to disable is one of the reasons I bought the phone.
  • The FM Radio doesn't appear to work. I'm not trying to get distant stations here . . .
  • MSN Live Search "Locate Me" feature doesn't work.
  • You're forced to buy an unlimited internet plan even if you will use less than 10MB/month.
  • The virtual keyboard takes up 3/4ths of the screen.
  • Samsung's default screen widgets are annoying and pointless. But you can turn them off and use the regular Windows Mobile home screen.
  • No included travel charger.
I think that a lot of what I hate about this phone is more due to Verizon Wireless than Samsung.

Wednesday, April 01, 2009

Powerpoint Macros with Aspose

This macro never worked for me because I didn't want to bother with the add-in that runs stuff when powerpoint starts.  Instead I made a text box in my template with the alt-text "instructions" and told people to hit F5, then click the box to run the macro that refreshes OLE Objects (excel charts) and also tables that for whatever reason were showing in the normal view, but not presentation view.  This shouldn't be needed for Aspose .NET since you can just use Aspose.Charts and render a picture of your actual chart to replace the "Object Changed" image that is the default.  Of course, I don't know if that strange occasional table bug affects the .NET version.

Sub Image1_Click()
    Dim ashape As Shape
    load_all_charts
    For Each ashape In ActivePresentation.Slides(1).Shapes
        If ashape.AlternativeText = "instructions" Then
            ashape.Delete
        End If
    Next
End Sub
Sub load_all_charts()
    Dim oShape As Shape
    Dim oSlide As Slide
    Dim oGraph As Object
    ActivePresentation.NewWindow.Activate
    ' Loop through each slide in the presentation
    For Each oSlide In ActivePresentation.Slides
        ActiveWindow.View.GotoSlide (oSlide.SlideNumber)
        ' Loop through all the shapes on the current slide.
        For Each oShape In oSlide.Shapes
            ' Check whether the shape is an OLE object.
            If oShape.Type = msoEmbeddedOLEObject Then
                ' Found an OLE object; run edit on it
                oShape.Select
                oShape.OLEFormat.DoVerb (0)
            End If
            If oShape.Type = msoTable Then
                oShape.Select
                oShape.Ungroup
                oSlide.Shapes.Range().Regroup
            End If
        Next oShape
    Next oSlide
    ActiveWindow.Close
    ActivePresentation.SlideShowWindow.Activate
End Sub
 
 Just set your instructions' text box onclick method to Image1_Click and make sure your users enable macros (or sign your presentation so they don't have to lower their security settings and macros are enabled automatically).  Also, don't forget that Aspose only preserves macros in the Presentation object you got by loading your template.  No creating a new presentation from scratch and copying slides to it.  Yes, this means you waste time loading the template file repeatedly.