Skip to content

Commit

Permalink
Marked variables and methods as global to match the classes (thanks t…
Browse files Browse the repository at this point in the history
…o Chris Peterson for pointing this out).
  • Loading branch information
tompatros committed Jan 16, 2012
1 parent ddb62ba commit 218277b
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 46 deletions.
8 changes: 4 additions & 4 deletions src/classes/Milestone1_Clone_Utility.cls
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
*/
global with sharing class Milestone1_Clone_Utility {

public static Milestone1_Project__c cloneProject(Milestone1_Project__c rec){
global static Milestone1_Project__c cloneProject(Milestone1_Project__c rec){
Milestone1_Project__c newRec = rec.clone(false);
newRec.ImportID__c = rec.Id;
return newRec;
}

public static Map<String, Milestone1_Milestone__c> cloneMilestonesIntoMap(List<Milestone1_Milestone__c> recs){
global static Map<String, Milestone1_Milestone__c> cloneMilestonesIntoMap(List<Milestone1_Milestone__c> recs){
Map<String, Milestone1_Milestone__c> recMap = new Map<String, Milestone1_Milestone__c>();
for(Milestone1_Milestone__c rec : recs){
Milestone1_Milestone__c newRec = rec.clone(false);
Expand All @@ -44,7 +44,7 @@ global with sharing class Milestone1_Clone_Utility {
return recMap;
}

public static List<Milestone1_Task__c> cloneTasksIntoList(List<Milestone1_Task__c> recs){
global static List<Milestone1_Task__c> cloneTasksIntoList(List<Milestone1_Task__c> recs){
List<Milestone1_Task__c> newRecs = new List<Milestone1_Task__c>();
for(Milestone1_Task__c rec : recs){
Milestone1_Task__c newRec = rec.clone(false);
Expand All @@ -53,7 +53,7 @@ global with sharing class Milestone1_Clone_Utility {
return newRecs;
}

public static Map<String, Milestone1_Task__c> cloneTasksIntoMap(List<Milestone1_Task__c> recs){
global static Map<String, Milestone1_Task__c> cloneTasksIntoMap(List<Milestone1_Task__c> recs){
Map<String, Milestone1_Task__c> recMap = new Map<String, Milestone1_Task__c>();
for(Milestone1_Task__c rec : recs){
Milestone1_Task__c newRec = rec.clone(false);
Expand Down
20 changes: 10 additions & 10 deletions src/classes/Milestone1_Export_Project_Controller.cls
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ global with sharing class Milestone1_Export_Project_Controller {
'Project is too large to export. Total characters must be less than ' + Milestone1_Import_Project_Controller.MAX_FILE_SIZE +
'. Current export would be $1 characters long. Please edit your project and try again';

public Milestone1_Project__c rec {get; set;}
public Boolean exportSuccess{get;set;}
public Document doc{get;set;}
public String errorMessage {get; private set;}
global Milestone1_Project__c rec {get; set;}
global Boolean exportSuccess{get;set;}
global Document doc{get;set;}
global String errorMessage {get; private set;}

public Milestone1_Export_Project_Controller(ApexPages.StandardController stc)
global Milestone1_Export_Project_Controller(ApexPages.StandardController stc)
{
errorMessage = null;

Expand All @@ -49,7 +49,7 @@ global with sharing class Milestone1_Export_Project_Controller {
];
}

public void createExportXML()
global void createExportXML()
{
Milestone1_XML_Export_Utility xmlUtil = new Milestone1_XML_Export_Utility();
String xmlString = xmlUtil.buildProjectXmlString(rec.Id);
Expand All @@ -74,21 +74,21 @@ global with sharing class Milestone1_Export_Project_Controller {
*
* @result Boolean True if any error has been flagged
*/
public Boolean hasError(){
global Boolean hasError(){
return this.errorMessage != null;
}

public PageReference returnToProject()
global PageReference returnToProject()
{
return new ApexPages.StandardController(rec).view();
}

public PageReference returnToDocument()
global PageReference returnToDocument()
{
return new ApexPages.StandardController(doc).view();
}

public Document saveToDocument(String name, String xml, String description) {
global Document saveToDocument(String name, String xml, String description) {
Document d = new Document();
d.body = Blob.valueOf(xml);
d.ContentType = 'text/xml';
Expand Down
26 changes: 13 additions & 13 deletions src/classes/Milestone1_Import_Project_Controller.cls
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
*/
global with sharing class Milestone1_Import_Project_Controller {
public Milestone1_Project__c project {get; set;}
public List<Document> docs {get;set;}
public List<SelectOption> docOptions {get;set;}
public String contentType {get;set;}
public String docId{get;set;}
public string fileName{get;set;}
public Blob fileBody{get;set;}
public Integer docsSize {get;set;}
public Integer maxFileSize {get; set;}
public static Integer MAX_FILE_SIZE = 500000;
global Milestone1_Project__c project {get; set;}
global List<Document> docs {get;set;}
global List<SelectOption> docOptions {get;set;}
global String contentType {get;set;}
global String docId{get;set;}
global string fileName{get;set;}
global Blob fileBody{get;set;}
global Integer docsSize {get;set;}
global Integer maxFileSize {get; set;}
global static Integer MAX_FILE_SIZE = 500000;

private static String CONTENT_ERROR = 'Content is not allowed in prolog.';

public Milestone1_Import_Project_Controller(ApexPages.StandardSetController ssc)
global Milestone1_Import_Project_Controller(ApexPages.StandardSetController ssc)
{
docOptions = new List<SelectOption>();
docs = [Select Id, Name from Document where Name like: 'EXPORT %' ];
Expand All @@ -52,7 +52,7 @@ global with sharing class Milestone1_Import_Project_Controller {
docsSize = docs.size();
}

public PageReference importTemplateXML() {
global PageReference importTemplateXML() {

try {

Expand Down Expand Up @@ -92,7 +92,7 @@ global with sharing class Milestone1_Import_Project_Controller {
}


public String getDocumentXMLString()
global String getDocumentXMLString()
{
List<Document> docs = [Select Id, Body, ContentType From Document Where Id = :docId limit 1];
if(docs.size() != 0)
Expand Down
14 changes: 7 additions & 7 deletions src/classes/Milestone1_XML_Export_Utility.cls
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ global with sharing class Milestone1_XML_Export_Utility {
private List<Milestone1_Task__c> subMilestonesTasks;
private Map<ID,Milestone1_Task__c> subMilestonesTasksMap;

public Milestone1_XML_Export_Utility()
global Milestone1_XML_Export_Utility()
{
milestonesMap = new Map<ID,Milestone1_Milestone__c>();
milestonesTasksMap = new Map<ID,Milestone1_Task__c>();
subMilestonesMap= new Map<ID,Milestone1_Milestone__c>();
subMilestonesTasksMap = new Map<ID,Milestone1_Task__c>();
}

public Milestone1_Project__c lookup(ID targetId) {
global Milestone1_Project__c lookup(ID targetId) {
Milestone1_Project__c project = [Select m.Kickoff__c,m.Deadline__c, m.Total_Hours_Budget__c, m.Total_Expense_Budget__c, m.Status__c, m.Name, m.Id, m.Description__c From Milestone1_Project__c m where Id = :targetId limit 1];
//Retrieve all the Milestones
milestones = [Select m1.Id, m1.Name, m1.Alias__c, m1.Deadline__c, m1.Kickoff__c, m1.Complete__c,m1.Description__c, m1.Expense_Budget__c, m1.Project__c, m1.Hours_Budget__c From Milestone1_Milestone__c m1 where Project__c = :project.Id and Parent_Milestone__c = null];
Expand Down Expand Up @@ -76,7 +76,7 @@ global with sharing class Milestone1_XML_Export_Utility {
return project;
}

public String buildProjectXmlString(ID targetId) {
global String buildProjectXmlString(ID targetId) {
project = lookup(targetId);
Xmlstreamwriter out = new Xmlstreamwriter();

Expand All @@ -102,7 +102,7 @@ global with sharing class Milestone1_XML_Export_Utility {
return ret;
}

void writeProjectToXML(XMLstreamwriter out, Milestone1_Project__c project )
global void writeProjectToXML(XMLstreamwriter out, Milestone1_Project__c project )
{
out.writeStartElement(null, Milestone1_Constants.OBJ_NAME_PROJECT, null);
writeElement(out,'Id',project.Id);
Expand All @@ -118,7 +118,7 @@ global with sharing class Milestone1_XML_Export_Utility {
out.writeEndElement();
}

void writeMilestoneToXML(XMLstreamwriter out, Milestone1_Milestone__c milestone, Boolean isParentMilestone )
global void writeMilestoneToXML(XMLstreamwriter out, Milestone1_Milestone__c milestone, Boolean isParentMilestone )
{
List<Milestone1_Task__c> tasks;
if(isParentMilestone)
Expand Down Expand Up @@ -153,7 +153,7 @@ global with sharing class Milestone1_XML_Export_Utility {
}


void writeTaskToXML(XMLstreamwriter out, Milestone1_Task__c task ){
global void writeTaskToXML(XMLstreamwriter out, Milestone1_Task__c task ){
out.writeStartElement(null, Milestone1_Constants.OBJ_NAME_TASK, null);
writeElement(out,'Id', task.Id);
writeElement(out,'Description__c',task.Description__c);
Expand All @@ -164,7 +164,7 @@ global with sharing class Milestone1_XML_Export_Utility {
out.writeEndElement();
}

void writeElement(Xmlstreamwriter out, String tag, Object content) {
global void writeElement(Xmlstreamwriter out, String tag, Object content) {
if(content != null){
out.writeStartElement(null, tag, null);
out.writeCharacters(EncodingUtil.urlEncode(String.valueOf(content), 'UTF-8'));
Expand Down
24 changes: 12 additions & 12 deletions src/classes/Milestone1_XML_Import_Utility.cls
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ OF THE POSSIBILITY OF SUCH DAMAGE.
*/
global with sharing class Milestone1_XML_Import_Utility {

public with sharing class XML_Metadata {
global with sharing class XML_Metadata {
String ExportVersion;
String ExportAuthor;
String ExportPackage;
Expand All @@ -44,7 +44,7 @@ global with sharing class Milestone1_XML_Import_Utility {
List<Milestone1_Time__c> times;
XML_Metadata metadata = new XML_Metadata();

public Milestone1_XML_Import_Utility()
global Milestone1_XML_Import_Utility()
{
project = new Milestone1_Project__c();
milestones = new List<Milestone1_Milestone__c>();
Expand All @@ -54,7 +54,7 @@ global with sharing class Milestone1_XML_Import_Utility {
times = new List<Milestone1_Time__c>();
}

public Milestone1_Project__c importProject(String xml) {
global Milestone1_Project__c importProject(String xml) {

Savepoint sp = Database.setSavepoint();
try{
Expand Down Expand Up @@ -131,7 +131,7 @@ global with sharing class Milestone1_XML_Import_Utility {
insert times;
}

void matchMilestonesToMilestones(List<Milestone1_Milestone__c> milestones, Milestone1_Milestone__c currentMilestone){
global void matchMilestonesToMilestones(List<Milestone1_Milestone__c> milestones, Milestone1_Milestone__c currentMilestone){
for(Milestone1_Milestone__c currentSubMilestone : milestones)
{
if(currentSubMilestone.Parent_Milestone__c == currentMilestone.ImportID__c)
Expand All @@ -142,7 +142,7 @@ global with sharing class Milestone1_XML_Import_Utility {
}
}

Boolean matchTaskToMilestone(List<Milestone1_Milestone__c> milestones, Milestone1_Task__c currentTask){
global Boolean matchTaskToMilestone(List<Milestone1_Milestone__c> milestones, Milestone1_Task__c currentTask){
for(Milestone1_Milestone__c currentMilestone : milestones){
if(currentTask.Project_Milestone__c == currentMilestone.ImportID__c){
currentTask.Project_Milestone__c = currentMilestone.Id;
Expand All @@ -152,7 +152,7 @@ global with sharing class Milestone1_XML_Import_Utility {
return false;
}

Boolean matchTimeToTask(List<Milestone1_Task__c> tasks, Milestone1_Time__c currentTime){
global Boolean matchTimeToTask(List<Milestone1_Task__c> tasks, Milestone1_Time__c currentTime){
for(Milestone1_Task__c currentTask : tasks){
if(currentTime.Project_Task__c == currentTask.ImportID__c){
currentTime.Project_Task__c = currentTask.Id;
Expand All @@ -162,7 +162,7 @@ global with sharing class Milestone1_XML_Import_Utility {
return false;
}

void parseProject(Xmlstreamreader reader) {
global void parseProject(Xmlstreamreader reader) {
//name goes to name
//id goes to importid
//System.debug(LoggingLevel.warn, 'in Project');
Expand Down Expand Up @@ -230,7 +230,7 @@ global with sharing class Milestone1_XML_Import_Utility {
}
}

void parseMilestone(Xmlstreamreader reader, Milestone1_Milestone__c parentMilestone)
global void parseMilestone(Xmlstreamreader reader, Milestone1_Milestone__c parentMilestone)
{

Milestone1_Milestone__c currentMilestone = new Milestone1_Milestone__c();
Expand Down Expand Up @@ -301,7 +301,7 @@ global with sharing class Milestone1_XML_Import_Utility {
}
}

void parseTask(XMLStreamreader reader, Milestone1_Milestone__c currentMilestone){
global void parseTask(XMLStreamreader reader, Milestone1_Milestone__c currentMilestone){
Milestone1_Task__c currentTask = new Milestone1_Task__c();
currentTask.Project_Milestone__c = currentMilestone.ImportID__c;
while(reader.hasNext())
Expand Down Expand Up @@ -357,7 +357,7 @@ global with sharing class Milestone1_XML_Import_Utility {
tasks.add(currentTask);
}

void parseTime(XMLStreamreader reader, Milestone1_Task__c currentTask){
global void parseTime(XMLStreamreader reader, Milestone1_Task__c currentTask){
Milestone1_Time__c currentTime = new Milestone1_Time__c();
currentTime.Project_Task__c = currentTask.ImportID__c;
while(reader.hasNext())
Expand Down Expand Up @@ -387,7 +387,7 @@ global with sharing class Milestone1_XML_Import_Utility {
times.add(currentTime);
}

void parseMeta(Xmlstreamreader reader) {
global void parseMeta(Xmlstreamreader reader) {
//system.debug('Process Metadata');
while (reader.hasNext()) {
//handle name field
Expand Down Expand Up @@ -427,7 +427,7 @@ global with sharing class Milestone1_XML_Import_Utility {
}
}

String getDecodedString(Xmlstreamreader reader) {
global String getDecodedString(Xmlstreamreader reader) {
return EncodingUtil.urlDecode(reader.getText(), 'UTF-8').trim();
}

Expand Down

0 comments on commit 218277b

Please sign in to comment.