DCValue[] dc = templateItem.getDC(Item.ANY, Item.ANY, Item.ANY);
DCValue[] md = templateItem.getMetadata(Item.ANY, Item.ANY, Item.ANY, Item.ANY);
    public static WorkspaceItem create(Context c, Collection coll,            boolean template) throws AuthorizeException, SQLException,            IOException    {        // Check the user has permission to ADD to the collection        AuthorizeManager.authorizeAction(c, coll, Constants.ADD);        // Create an item        Item i = Item.create(c);        i.setSubmitter(c.getCurrentUser());        // Now create the policies for the submitter and workflow        // users to modify item and contents        // contents = bitstreams, bundles        // FIXME: icky hardcoded workflow steps        Group step1group = coll.getWorkflowGroup(1);        Group step2group = coll.getWorkflowGroup(2);        Group step3group = coll.getWorkflowGroup(3);        EPerson e = c.getCurrentUser();        // read permission        AuthorizeManager.addPolicy(c, i, Constants.READ, e);        if (step1group != null)        {            AuthorizeManager.addPolicy(c, i, Constants.READ, step1group);        }        if (step2group != null)        {            AuthorizeManager.addPolicy(c, i, Constants.READ, step2group);        }        if (step3group != null)        {            AuthorizeManager.addPolicy(c, i, Constants.READ, step3group);        }        // write permission        AuthorizeManager.addPolicy(c, i, Constants.WRITE, e);        if (step1group != null)        {            AuthorizeManager.addPolicy(c, i, Constants.WRITE, step1group);        }        if (step2group != null)        {            AuthorizeManager.addPolicy(c, i, Constants.WRITE, step2group);        }        if (step3group != null)        {            AuthorizeManager.addPolicy(c, i, Constants.WRITE, step3group);        }        // add permission        AuthorizeManager.addPolicy(c, i, Constants.ADD, e);        if (step1group != null)        {            AuthorizeManager.addPolicy(c, i, Constants.ADD, step1group);        }        if (step2group != null)        {            AuthorizeManager.addPolicy(c, i, Constants.ADD, step2group);        }        if (step3group != null)        {            AuthorizeManager.addPolicy(c, i, Constants.ADD, step3group);        }        // remove contents permission        AuthorizeManager.addPolicy(c, i, Constants.REMOVE, e);        if (step1group != null)        {            AuthorizeManager.addPolicy(c, i, Constants.REMOVE, step1group);        }        if (step2group != null)        {            AuthorizeManager.addPolicy(c, i, Constants.REMOVE, step2group);        }        if (step3group != null)        {            AuthorizeManager.addPolicy(c, i, Constants.REMOVE, step3group);        }        // Copy template if appropriate        Item templateItem = coll.getTemplateItem();        if (template && (templateItem != null))        {            DCValue[] dc = templateItem.getDC(Item.ANY, Item.ANY, Item.ANY);            for (int n = 0; n < dc.length; n++)            {                i.addDC(dc[n].element, dc[n].qualifier, dc[n].language,                        dc[n].value);            }        }        i.update();        // Create the workspace item row        TableRow row = DatabaseManager.create(c, "workspaceitem");        row.setColumn("item_id", i.getID());        row.setColumn("collection_id", coll.getID());        log.info(LogManager.getHeader(c, "create_workspace_item",                "workspace_item_id=" + row.getIntColumn("workspace_item_id")                        + "item_id=" + i.getID() + "collection_id="                        + coll.getID()));        DatabaseManager.update(c, row);        WorkspaceItem wi = new WorkspaceItem(c, row);        HistoryManager.saveHistory(c, wi, HistoryManager.CREATE, c                .getCurrentUser(), c.getExtraLogInfo());        return wi;    }