How to change alfresco landing page

Do you wanna change the landing page for your alfresco i tested this on 4.0 and 5.0 and this work in this way, you have just to modify the file in this directory

/opt/alfresco-5.0.b/tomcat/webapps/share/site-index.jsp

and modify the row where you read

// redirect to site or user dashboard as appropriate

below an example of site-index.jsp to use as landing page the repository page


<%@ page import="org.alfresco.web.site.*" %>
<%@ page import="org.springframework.extensions.surf.*" %>
<%@ page import="org.springframework.extensions.surf.site.*" %>
<%@ page import="org.springframework.extensions.surf.util.*" %>
<%@ page import="java.util.*" %>
<% // retrieve user name from the session String userid = (String)session.getAttribute(SlingshotUserFactory.SESSION_ATTRIBUTE_KEY_USER_ID); // test user dashboard page exists? RequestContext context = (RequestContext)request.getAttribute(RequestContext.ATTR_REQUEST_CONTEXT); if (!context.getObjectService().hasPage("user/" + userid + "/dashboard")) { // no user dashboard page found! create initial dashboard for this user... Map tokens = new HashMap();
tokens.put("userid", userid);
FrameworkUtil.getServiceRegistry().getPresetsManager().constructPreset("user-dashboard", tokens);
}

// redirect to site or user dashboard as appropriate
String siteName = request.getParameter("site");
if (siteName == null || siteName.length() == 0)
{
// forward to user specific dashboard page
// response.sendRedirect(request.getContextPath() + "/page/user/" + URLEncoder.encode(userid) + "/dashboard");
response.sendRedirect(request.getContextPath() + "/page/repository");
}
else
{
// forward to site specific dashboard page
//response.sendRedirect(request.getContextPath() + "/page/site/" + URLEncoder.encode(siteName) + "/dashboard");
response.sendRedirect(request.getContextPath() + "/page/repository");
}
%>

Alfresco5 modify header menu

Alfresco 5 use dojo to create his header menu therefore you have to modify the javascript that create that header menu, the header menu is create by an Array that you can find on this directory

/opt/alfresco-5.0.b/tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/share/imports/share-header.lib.js

 

In this code you have to find the part of code with title CONSTRUCT MENU BAR LEFT the array that create the menu bar is appItems, isert inside everything you want see in header menu.
If you want that visible just to admin, just add the if condition like this if(user.isAdmin).

Below and example of code to show just repository tab on header menu for normal user and the original header for the administrator

/* *********************************************************************************
* *
* CONSTRUCT LEFT MENU BAR (NEW) *
* *
***********************************************************************************/
/*
* This function generates the "app items" to include in the header. In actual fact this just refers to the
* items that are rendered on the left-hand-side of the screen but for historical reasons (and because of the
* default values) can be regarded as application items.
*/
function generateAppItems() {
var appItems = [ {
id: "HEADER_REPOSITORY",
name: "alfresco/menus/AlfMenuBarItem",
config: {
id: "HEADER_REPOSITORY",
label: "header.menu.repository.label",
targetUrl: "repository"
}
}

];
if (user.isAdmin )
{
appItems.push( {
id: "HEADER_HOME",
name: "alfresco/menus/AlfMenuBarItem",
config: {
id: "HEADER_HOME",
label: "header.menu.home.label",
targetUrl: "user/" + encodeURIComponent(user.name) + "/dashboard"
}
},
{
id: "HEADER_MY_FILES",
name: "alfresco/menus/AlfMenuBarItem",
config: {
id: "HEADER_MY_FILES",
label: "header.menu.myfiles.label",
targetUrl: "context/mine/myfiles"
}
},
{
id: "HEADER_SHARED_FILES",
name: "alfresco/menus/AlfMenuBarItem",
config: {
id: "HEADER_SHARED_FILES",
label: "header.menu.shared.label",
targetUrl: "context/shared/sharedfiles"
}
},
{
id: "HEADER_SITES_MENU",
name: "alfresco/header/AlfSitesMenu",
config: {
id: "HEADER_SITES_MENU",
label: "header.menu.sites.label",
currentSite: page.url.templateArgs.site,
currentUser: user.name
}
},
{
id: "HEADER_TASKS",
name: "alfresco/header/AlfMenuBarPopup",
config: {
id: "HEADER_TASKS",
label: "header.menu.tasks.label",
widgets: [
{
name: "alfresco/menus/AlfMenuGroup",
config: {
widgets: [
{
id: "HEADER_MY_TASKS",
name: "alfresco/header/AlfMenuItem",
config:
{
id: "HEADER_MY_TASKS",
label: "header.menu.mytasks.label",
iconClass: "alf-mytasks-icon",
targetUrl: "my-tasks#filter=workflows|active"
}
},
{
id: "HEADER_MY_WORKFLOWS",
name: "alfresco/header/AlfMenuItem",
config:
{
id: "HEADER_MY_WORKFLOWS",
label: "header.menu.myworkflows.label",
iconClass: "alf-myworkflows-icon",
targetUrl: "my-workflows#filter=workflows|active"
}
}
]
}
}
]
}
},
{
id: "HEADER_PEOPLE",
name: "alfresco/menus/AlfMenuBarItem",
config: {
id: "HEADER_PEOPLE",
label: "header.menu.people.label",
targetUrl: "people-finder"
}
});
}
if (user.isAdmin)
{
appItems.push({
id: "HEADER_ADMIN_CONSOLE",
name: "alfresco/menus/AlfMenuBarItem",
config: {
id: "HEADER_ADMIN_CONSOLE",
label: "header.menu.admin.label",
targetUrl: "console/admin-console/application"
}
});
}
else
{
appItems.push({
id: "HEADER_ADMIN_CONSOLE",
name: "alfresco/menus/AlfMenuBarItem",
config: {
id: "HEADER_SITES_CONSOLE",
label: "header.menu.admin.sites.label",
targetUrl: "console/sites-console/manage-sites",
renderFilter: [
{
property: "user.groups.GROUP_SITE_ADMINISTRATORS",
values: [true]
}
]
}
});
}
return appItems;
}

Move DNS from TopHost to DreamHost

Lately I have some domains registered on Tophost.it, then managing them directly on my Dreamhost account.

I chose tophost because  (aside from the hosting service that is worth what it costs) allows you to modify your DNS very simply and has some decent update times.

The steps you take to make sure that the DNS are then managed by Dreamhost are few and simple:

  • In the Dreamhost panel, create a new domain (using what you want to move), take note of the DNS domain associated with the shell (if you use linux) obtained the IP address associated with the latter using:  $ Dig@ns1.dreamhost.com Yourdomain.XXX
  • Go now in the admin panel Tophost and click “DNS Service”, you will be redirected to the DNS management panel .
  • At this point started www deleted the item corresponding to a parameter and replace it with a CNAME entry: Name = www, type = A, IP = value obtained from the dig made ​​previously. If you want to register a domain without the www in front of you use the @ character in the name field.
  • Now delete ALL the other entry, now you should get a screen like this:

    Tophost Admin Panel Example

  • Wait for the DNS propagation (About 24 or 48 hours)
  • Create subdomains on Dreamhost and check its operation.

This is all for now, coming next i will explain how to enable the use of the mail servers.
source

Install Django

Official procedure to install Django in Manazag Team

Ubuntu

Install PIP and update itself
sudo apt-get install python-pip
sudo pip install -U pip

Install latest Django version
sudo pip install Django

or upgrade to latest Django version
sudo pip install Django --upgrade

or install a specific Django version
sudo pip install Django==1.6.2

Tested on:

  • Ubuntu
    • 12.04

A Simple Guide to Creating Social Media Sharing Button in HTML

The first things is a create a button using an image (here you can download some amazing button) under an example of clickable button with using HTML code

<a href=”#”><img src=”social.png”></a>

A Visual Example of clickable button

Now the last thing to do a to use the API of every single social to create the share event, in the button create previously you have to add in href section the below URL for Every Single Social
where you will see <SITE> is your URL to share, <TITLE> is the title to insert into the share(where is allow), <TAG> Used to TAG your Page

SOCIAL URL
Facebook http://www.facebook.com/sharer.php?u=<SITE>
Twitter http://twitter.com/share?url=<SITE>&text=<TITLE>@<TAG>
Google+ https://plus.google.com/share?url=<SITE>
Tumblr http://www.tumblr.com/share/link?url=<SITE>&name=<TITLE>
Pinterest javascript:void((function()%7Bvar%20e=document.createElement(‘script’);e.setAttribute(‘type’,’text/javascript’);e.setAttribute(‘charset’,’UTF-8′);e.setAttribute(‘src’,’http://assets.pinterest.com/js/pinmarklet.js?r=’+Math.random()*99999999);document.body.appendChild(e)%7D)());
Linekdin http://www.linkedin.com/shareArticle?mini=true&url=<SITE>
Buffer https://bufferapp.com/add?url=<SITE>&text=%20<TITLE>
Digg http://www.digg.com/submit?url=<SITE>
Reddit http://reddit.com/submit?url=<SITE>&title=<TITLE>
Flattr https://flattr.com/submit/auto?\user_id=&url=<SITE>
StumbleUpon http://www.stumbleupon.com/submit?url=<SITE>&title=<TITLE>

Example of HTML code with Google+

<a href=”https://plus.google.com/share?url=http://www.manazag.com”><img src=”/images/google.png”></a>

Here a clickable button

now finally you have a new one cool share button for the most popular social in the world

AN ADVISE: if you use this button into an email(for example into a newsletter) some email provider can report it as spam or phishing mail, to get around this problem i ussually shorten the URL above with site like

http://bit.ly
http://tinyurl.com

Start new project

Official procedure to start a new project in Manazag Team

  1. create a repo on bitbucket
  2. follow bitbucket procedure to create a new project from scratch
    1. up to first commit of README.md file
  3. go to wiki related to bitbucket new project
  4. clone wiki into repo
  5. commit

 

README.md should contain only generic info

source code should be placed under src folder

wiki should be placed under wiki folder

Complete Guide to Commit on BitBucket.org using Git & UBUNTU

FIRST STEP CREATE SSH KEY

    1. List the contents of your ~/.ssh directory.
      pc:~ ubuntu$ ls -a ~/.ssh
      known_hosts
    2. Create your ssh key
      pc:~ ubuntu$ ssh-keygen
      Generating public/private rsa key pair.
      Enter file in which to save the key (/Users/manthony/.ssh/id_rsa): 
      Created directory '/Users/manthony/.ssh'.
      Enter passphrase (empty for no passphrase): 
      Enter same passphrase again: 
      Your identification has been saved in /Users/manthony/.ssh/id_rsa.
      Your public key has been saved in /Users/manthony/.ssh/id_rsa.pub.
      The key fingerprint is:
      4c:80:61:2c:00:3f:9d:dc:08:41:2e:c0:cf:b9:17:69 manthony@myhost.local
      The key's randomart image is:
      +--[ RSA 2048]----+
      |*o+ooo.          |
      |.+.=o+ .         |
      |. *.* o .        |
      | . = E o         |
      |    o . S        |
      |   . .           |
      |    .            |
      |                 |
      |                 |
      +-----------------+
    3. List the contents of ~/.ssh to view the key files.
      
      ls -a ~/.ssh
    4. Open a terminal window and enter the ps -e | grep [s]sh-agent command to see if the agent is running:
      pc:~ ubuntu$ ps -e  | grep [s]sh-agent
       9060 ??         0:00.28 /usr/bin/ssh-agent -l

      If the agent isn’t running, start it manually with the following command:

      myhost:~ manthony$ ssh-agent /bin/bash
      
      

       

 

  • Load your new identity into the ssh-agent management program using the ssh-add command.
    $ ssh-add ~/.ssh/id_rsa
    Enter passphrase for /Users/manthony/.ssh/id_rsa: 
    Identity added: /Users/ubuntu/.ssh/id_rsa (/Users/manthony/.ssh/id_rsa)
    pc:~ ubuntu$

    Use the ssh-add command to list the keys that the agent is managing.

    $ ssh-add -l
    2048 7a:9c:b2:9c:8e:4e:f4:af:de:70:77:b9:52:fd:44:97 /Users/ubuntu/.ssh/id_rsa (RSA)

    Install the public key on your Bitbucket account

     

    1. Open a browser and log into Bitbucket.
    2. Choose avatar > Manage Account from the application menu.
      The system displays the Account settings page.
    3. Click SSH keys.
      The SSH Keys page displays. It shows a list of any existing keys. Then, below that, a dialog for labeling and entering a new key.
    4. Back in your terminal window, copy the contents of your public key file.
      For example, in Linux you can cat the contents.

 

cat ~/.ssh/id_rsa.pub

5. Paste the copied public key into the SSH Key field:

 

https://confluence.atlassian.com/pages/viewpage.action?pageId=270827678

 

SECOND STEP COMMITING YOUR PROJECT

Loggarsi su https://bitbucket.org
Aggiungere un repository (menù in alto a destra) se già non è stato creato in precedenza.
In fase di creazione assicurarsi che il progetto abbia il flag “Private” attivo o no a seconda del tipo di progetto che si vuole creare.
In locale sul linux/mac:
aprire il terminale
posizionarsi nella directory del progetto
eseguire questi comandi:
git init
git add . (mi raccomando il . è fondamentale)
git commit -m “Messaggio iniziale o qualunque altra cosa”
Ok in locale il progetto è “gittato”, ora però bisogna renderlo disponibile al team in remoto con gli ultimi passaggi sempre da terminale e sempre nella stessa posizione:
git remote add origin https://utente@bitbucket.org/utente/progetto_creato_in_precedenza_sul_sito_bitbucket.git
git push https://utente@bitbucket.org/utente/progetto_creato_in_precedenza_sul_sito_bitbucket.git master
Ora l’intero progetto è stato copiato in remoto.
Direi semplice e indolore 🙂

 

 

How to get Mac OSX Snow Leopard using VirtualBox on PC


UPDATED SNOW LEOPARD ISO DOWNLOAD LINK! PLEASE LOOK BELOW!

This tutorial will show you how to get Snow Leopard for any windows PC !
We’re going to do this tutorial with VirtualBox! (It works faster and better then VMware in my opinion). Everything works perfectly : Sound, internet, .dmg’s!

Download links:

Updated Snow Leopard ISO download link:
http://kat.ph/snow-leopard-10-6-1-10-…
________________________________________­_________________
Snow leopard ISO : http://leohazard.com/download.html

BitTorrent : http://www.bittorrent.com/btusers/dow…

VirtualBox: http://www.virtualbox.org/wiki/Downloads

WinRAR: http://www.rarlab.com/download.htm